Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

display pop up window overlay permission in redmi android studio

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            if (!Settings.canDrawOverlays(this)) {
                if ("xiaomi".equals(Build.MANUFACTURER.toLowerCase(Locale.ROOT))) {
                    final Intent intent =new Intent("miui.intent.action.APP_PERM_EDITOR");
                    intent.setClassName("com.miui.securitycenter",
                            "com.miui.permcenter.permissions.PermissionsEditorActivity");
                    intent.putExtra("extra_pkgname", getPackageName());
                    new AlertDialog.Builder(this)
                            .setTitle("Please Enable the additional permissions")
                            .setMessage("You will not receive notifications while the app is in background if you disable these permissions")
                            .setPositiveButton("Go to Settings", new DialogInterface.OnClickListener() {
                                public void onClick(DialogInterface dialog, int which) {
                                    startActivity(intent);
                                }
                            })
                            .setIcon(android.R.drawable.ic_dialog_info)
                            .setCancelable(false)
                            .show();
                }else {
                    Intent overlaySettings = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getPackageName()));
                    startActivityForResult(overlaySettings, OVERLAY_REQUEST_CODE);
                }
            }
        }
Comment

PREVIOUS NEXT
Code Example
Java :: bukkit scheduler self cancelling task 
Java :: java structure 
Java :: nullpointerexception 
Java :: final variables in java 
Java :: what is inheritance in java 
Java :: /= java 
Java :: hashtable 
Java :: what are abstract classes in java 
Java :: how to make a for loop increment by 2 in java 
Java :: java lambda function 
Java :: convert long to localdatetime java 
Java :: camel java 
Java :: Java find duplicate items 
Java :: java deserialize json object 
Java :: java how to write something on the console with scanner 
Java :: loop through array in java 
Java :: thymeleaf spring boot dependency for mail 
Java :: java in 5 minutes 
Java :: spring mock Streamble of object 
Java :: interact with databse java 
Sql :: delete mysql ubuntu 20.04 
Sql :: guid to string sql 
Sql :: mysql alter column default 
Sql :: pl sql output 
Sql :: mysql CURRENT_TIMESTAMP() 
Sql :: sql server read uncommitted 
Sql :: remove accented characters from string sql 
Sql :: his is incompatible with sql_mode=only_full_group_by 
Sql :: oracle search text in all packages 
Sql :: sql query to find duplicates in column 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =