Android 跳转到应用设置详情界面

跳转到应用设置界面

public static void toSelfSetting(Context context) {  

    Intent mIntent = new Intent();  
    mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
    if (Build.VERSION.SDK_INT >= 9) {  
        mIntent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");  
        mIntent.setData(Uri.fromParts("package", context.getPackageName(), null));  
    } else if (Build.VERSION.SDK_INT <= 8) {  
        mIntent.setAction(Intent.ACTION_VIEW);  
        mIntent.setClassName("com.android.settings", "com.android.setting.InstalledAppDetails");  
        mIntent.putExtra("com.android.settings.ApplicationPkgName", context.getPackageName());  
    }  
    context.startActivity(mIntent);  

}  

跳转到系统设置

Intent mItent=new Intent(Settings.ACTION_SETTINGS); 

 startActivity(mIntent);  

 

你可能感兴趣的:(Android)