在我的应用程序,我有一个名为EXIT按钮,当用户点击的是,我要完成我的应用程序的所有活动,这是在堆栈,并转到默认主页活动或所有应用中的活动。如何以编程方式进入Android的默认主屏幕?
我写了下面的代码在我onClick()
:
Intent intent = new Intent(Intent.CATEGORY_HOME);
startActivity(intent);
但它给我的logcat以下错误:
03-12 11:22:18.279: ERROR/AndroidRuntime(308): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.category.HOME }
那么,我需要做的,实现这一目标?我需要在清单中进行一些配置还是我的方法错误?
可能重复(http://stackoverflow.com/questions/3724509 /以编程方式进入主屏幕) – 2014-03-01 16:45:58