新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Android應用程序組件Activity的"singleTask"(4)
注意,這里的Subactivity的launchMode屬性配置為"singleTask"。

樺南網(wǎng)站建設公司創(chuàng)新互聯(lián),樺南網(wǎng)站設計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為樺南數(shù)千家提供企業(yè)網(wǎng)站建設服務。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站建設要多少錢,請找那個售后服務好的樺南做網(wǎng)站的公司定做!
再來看界面配置文件。
它們定義在res/layout目錄中,main.xml文件對應MainActivity的界面:
[html] view plaincopy
- Android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:gravity="center"> android:id="@+id/button_start"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:text="@string/start" >
而sub.xml對應SubActivity的界面:[html] view plaincopy
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:gravity="center"> android:id="@+id/button_finish"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:text="@string/finish" >
字符串文件位于res/values/strings.xml文件中:[html] view plaincopy
- Task
- Sub Activity
- Start singleTask activity
- Finish activity
***,我們還要在工程目錄下放置一個編譯腳本文件Android.mk:
- [html] view plaincopyLOCAL_PATH:= $(call my-dir)
- include $(CLEAR_VARS)
- LOCAL_MODULE_TAGS := optional
- LOCAL_SRC_FILES := $(call all-subdir-java-files)
- LOCAL_PACKAGE_NAME := Task
- include $(BUILD_PACKAGE)
標題名稱:Android應用程序組件Activity的"singleTask"(4)
網(wǎng)站URL:http://www.5511xx.com/article/cojhpgc.html


咨詢
建站咨詢
