android判断应用是否为默认
Intent mHomeIntent = new Intent(Intent.ACTION_MAIN);
mHomeIntent.addCategory(Intent.CATEGORY_HOME);
mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
ResolveInfo mInfo = getPackageManager().resolveActivity(mHomeIntent, 0);
String activity_name = mInfo.activityInfo.name;
String package_name = mInfo.activityInfo.packageName;
String toast_content = "";
System.out.println("activity_name:" + activity_name);
System.out.println("package_name:" + package_name);
新的博客地址 http://ihongqiqu.com