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
看起來他們不再爲第三方提供這些服務。我不能說我對此感到驚訝。 – CommonsWare