日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Android >内容正文

Android

【起航计划 011】2015 起航计划 Android APIDemo的魔鬼步伐 10 App-Activity-Reorder Activities 后退栈 Intent FLAG...

發布時間:2023/12/13 Android 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【起航计划 011】2015 起航计划 Android APIDemo的魔鬼步伐 10 App-Activity-Reorder Activities 后退栈 Intent FLAG... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Reorder Activities 示例有四個相關的Activitives: ReorderOnLaunch, ReorderTwo,ReorderThree, ReorderFour。其中ReorderOnLaunch為主Activity,ReorderOnLaunch啟動ReorderTwo ,ReorderTwo啟動 ReorderThree,ReorderThree啟動 ReorderFour。 這時在Activity的”back stack”有如下狀態:

ReorderFour 想再啟動ReorderTwo, 這時用兩種實現方法,一是在 RecordFour之上再啟動一個新的 ReorderTwo ,這是startActivity的缺省行為。這是因為在AndroidManifest.xml:

<activity android:name=”.app.ReorderTwo” /> <activity android:name=”.app.ReorderThree” /> <activity android:name=”.app.ReorderFour” />

?

.app.RecordTwo沒有定義任何這個Intent的Flag。 比如有 FLAG_ACTIVITY_NEW_TASK,FLAG_ACTIVITY_CLEAR_TOP,FLAG_ACTIVITY_SINGLE_TOP,在這些情況下 Android將根據不同Flag設置來決定啟動RecordTwo的方法,具體在后面的例子會有介紹。

在Reorder Activities例子中,是將“Back Stack”中的ReorderTwo移到棧頂,方法是在啟動Intent時設置 Intent.FLAG_ACTIVITY_REORDER_TO_FRONT。如果設置了 FLAG_ACTIVITY_REORDER_TO_FRONT表示將“Back Stack”中指定的Activity移動到棧頂。

Intent intent = new Intent(ReorderFour.this, ReorderTwo.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent);

?

此時棧如下圖所示:

?

轉載于:https://www.cnblogs.com/dongdong230/p/4310553.html

總結

以上是生活随笔為你收集整理的【起航计划 011】2015 起航计划 Android APIDemo的魔鬼步伐 10 App-Activity-Reorder Activities 后退栈 Intent FLAG...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。