Android世界

Activity的启动四种模式

2016-03-05  本文已影响206人  WilsonMing

Activity的启动四种模式

<activity
           android:name=".launchmode.SingleTopActivity"
           android:label="@string/title_activity_single_top"
           android:launchMode="singleTop"
           android:theme="@style/AppTheme" />
- 第二种

````
Intent intent=new Intent(this,SingleTopActivity.class);
            intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
            startActivity(intent);
````
第二种优先第一种,如果同时存在则以第二种方式为准

任务栈属性:

Activity的IntentFilter

<data android:scheme="string"
          android:host="string"
          android:port="string"
          android:path="string"
          android:pathPattern="string"
          android:pathPrefix="string"
          android:mimeType="string"/>
上一篇 下一篇

猜你喜欢

热点阅读