2016-04-20 23 views
0

這工作完全在棒棒糖:如何複製Android棉花糖中的「近期任務/應用程序」按鈕?

recents_button.setOnClickListener(new View.OnClickListener() { 
     public void onClick(View v) { 
      // Perform action on click 
      Intent intent = new Intent ("com.android.systemui.recents.SHOW_RECENTS"); 
      intent.setComponent (new ComponentName ("com.android.systemui", "com.android.systemui.recents.RecentsActivity")); 
      startActivity (intent); 
     } 

但在棉花糖,我得到:

java.lang.SecurityException: Permission Denial: starting Intent { act=com.android.systemui.recents.SHOW_RECENTS cmp=com.android.systemui/.recents.RecentsActivity } from ProcessRecord{96f7c1e 4931:com.myapp/u0a188} (pid=4931, uid=10188) not exported from uid 10043 
+0

看起來他們不再爲第三方提供這些服務。我不能說我對此感到驚訝。 – CommonsWare

回答

2

你可以看到,意圖是通過not exported棉花糖,而它was exported由奇巧。

塔斯克能夠顯示最近的應用程序對話框,我不知道它是如何做到的。

相關問題