我想回到RecognitionListener中的MainActivity
onResults(Bundle results) {
if(results == "go to keep"){
Intent intent = new Intent();
intent.setAction(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(new ComponentName("com.google.android.keep", "com.google.android.keep.activities.BrowseActivity"));
startActivity(intent);
}
if(results == "back")
//back to MainActivity
}
答案 0 :(得分:-1)
您可以在Manifest中将其设置为拥有父级。
请看这里:http://developer.android.com/training/implementing-navigation/ancestral.html
如果您尝试从识别侦听器启动MainActivity,那么您希望执行以下操作:http://developer.android.com/training/basics/firstapp/starting-activity.html