一般android手机回到桌面:
Intent i = new Intent(Intent.ACTION_MAIN);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.addCategory(Intent.CATEGORY_HOME);
startActivity(i);
听说联想乐ipone使用上述方法会崩溃,(自己没有验证过)因此,可采用如下方法处理:
Intent mHomeIntent = new Intent(Intent.ACTION_MAIN, null);
mHomeIntent.putExtra("GOHOME","GOHOME");
mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
mHomeIntent.putExtra("GOHOME","GOHOME");
mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
mHomeIntent.setClassName("com.android.launcher","com.android.launcher.HomeScreen");
startActivity(mHomeIntent);
mHomeIntent.setClassName("com.android.launcher","com.android.launcher.HomeScreen");
startActivity(mHomeIntent);