2016-08-19 25 views
0

我有3個活動A,B,C.機器人:excludeFromRecents = 「真」,在清單

在的manifest.xml,A和B固定用android:excludeFromRecents="true"

A=Main Activity (secured) 
B=Base activity (secured) 
C=Extra activity (Less secured) 

但是,我想顯示Activity C已多少次出現在應用程序啓動最近。

請指導我。

回答

0

我認爲你需要做的是在啓動Activity C或者該標誌的一些變化時添加FLAG_ACTIVITY_NEW_TASK標誌。

你可以閱讀更多一些關於開展活動here不同的方式

例如:

Intent i = new Intent(this, AcitivityC.class); 
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
startActivity(i); 
+0

你想重定向人們正確的網址是:https://developer.android.com/ guide/components/tasks-and-back-stack.html – estoke

+0

更新了鏈接。 –