<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    常用鏈接

    統計

    最新評論

    onNewIntent 什么時候調用

    protected void onNewIntent (Intent intent)

    Since: API Level 1

    This is called for activities that set launchMode to "singleTop" in their package, or if a client used theFLAG_ACTIVITY_SINGLE_TOP flag when calling startActivity(Intent). In either case, when the activity is re-launched while at the top of the activity stack instead of a new instance of the activity being started, onNewIntent() will be called on the existing instance with the Intent that was used to re-launch it.

    An activity will always be paused before receiving a new intent, so you can count on onResume() being called after this method.

    Note that getIntent() still returns the original Intent. You can use setIntent(Intent) to update it to this new Intent.


    在IntentActivity中重寫下列方法:onCreate onStart onRestart  onResume  onPause onStop onDestroy  onNewIntent
    一、其他應用發Intent,執行下列方法:
    I/@@@philn(12410): onCreate
    I/@@@philn(12410): onStart
    I/@@@philn(12410): onResume

    發Intent的方法:
    Uri uri = Uri.parse("philn://blog.163.com");
    Intent it = new Intent(Intent.ACTION_VIEW, uri);    
    startActivity(it);

    二、接收Intent聲明:
     <activity android:name=".IntentActivity" android:launchMode="singleTask"
                      android:label="@string/testname">
                 <intent-filter>
                    <action android:name="android.intent.action.VIEW" />
                    <category android:name="android.intent.category.DEFAULT" />
                    <category android:name="android.intent.category.BROWSABLE" />
                    <data android:scheme="philn"/>
                </intent-filter>
      </activity>

    三、如果IntentActivity處于任務棧的頂端,也就是說之前打開過的Activity,現在處于
    I/@@@philn(12410): onPause
    I/@@@philn(12410): onStop 狀態的話
    其他應用再發送Intent的話,執行順序為:
    I/@@@philn(12410): onNewIntent
    I/@@@philn(12410): onRestart
    I/@@@philn(12410): onStart
    I/@@@philn(12410): onResume

    posted on 2011-02-14 11:18 九寶 閱讀(6204) 評論(1)  編輯  收藏 所屬分類: android

    評論

    # re: onNewIntent 什么時候調用 2012-02-14 10:12 tingtingyang

    寫的很清晰!支持  回復  更多評論   

    主站蜘蛛池模板: 男男黄GAY片免费网站WWW| 最新亚洲精品国偷自产在线| 人成午夜免费大片在线观看| 国产成人无码免费视频97 | 亚洲一区二区三区四区在线观看 | 亚洲精品线在线观看| 国产一级a毛一级a看免费人娇| 亚洲无码高清在线观看| jizz18免费视频| 久久亚洲2019中文字幕| 好紧我太爽了视频免费国产| 亚洲高清国产AV拍精品青青草原 | 亚洲三级视频在线观看| 无码中文在线二区免费| 亚洲日产乱码一二三区别| 国产又粗又猛又爽又黄的免费视频 | 国产黄色免费网站| 亚洲av乱码一区二区三区香蕉| 国产无人区码卡二卡三卡免费| 亚洲夂夂婷婷色拍WW47| 亚洲免费视频在线观看| 91成人免费观看| 亚洲综合成人婷婷五月网址| 四只虎免费永久观看| yellow免费网站| 亚洲AV永久无码区成人网站 | 国产成人va亚洲电影| 最新国产AV无码专区亚洲| 在线观看免费av网站| 亚洲精品中文字幕| 亚洲一区二区三区自拍公司| 24小时在线免费视频| 亚洲av色香蕉一区二区三区 | 免费无码一区二区三区蜜桃大| 特级毛片全部免费播放a一级| 亚洲精品国产精品乱码不卡√| 97视频热人人精品免费| 国产乱子伦精品免费视频| 亚洲综合久久久久久中文字幕| 免费国产不卡午夜福在线| 无码国产精品一区二区免费vr|