Compatible with the Enable floating window setting interface of MIUI5 and MIUI6, miui5miui6

Source: Internet
Author: User

Compatible with the Enable floating window setting interface of MIUI5 and MIUI6, miui5miui6

Some time ago, the project needed to boot and jump to the MIUI floating window enable setting interface. In MIUI6, the position of enabling the floating window setting was changed, find the solution and paste it for your reference and use.


@ Overridepublic void onClick (View view) {// close the prompt box MIUIFloatWindowHelpDialog. this. dismiss (); // jump to the settings page. try {Intent localIntent = new Intent ("miui. intent. action. APP_PERM_EDITOR "); localIntent. setClassName ("com. miui. securitycenter "," com. miui. permcenter. permissions. apppermissionseditequaltient "); localIntent. putExtra ("extra_pkgname", view. getContext (). getPackageName (); view. getContext (). startActivity (localIntent);} catch (ActivityNotFoundException localActivityNotFoundException) {Intent intent = new Intent (Settings. ACTION_APPLICATION_DETAILS_SETTINGS); Uri uri = Uri. fromParts ("package", view. getContext (). getPackageName (), null); intent. setData (uri); view. getContext (). startActivity (intent );}}
Xiaomi is a nightmare for developers ~~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.