search

Home  >  Q&A  >  body text

java - android 6.0 以上版本或者小米手机,如果要在application中需要写权限如何申请?

PHPzPHPz2898 days ago355

reply all(3)I'll reply

  • 天蓬老师

    天蓬老师2017-04-18 10:42:56

    Refactor the code and put the business into Activity
    I didn’t look at the permission application code, but from the effect it is a Dialog. This requires an Activity to host it. Even if you don’t put the permission application code into Activity, You can only start a new Activity implementation.

    reply
    0
  • PHPz

    PHPz2017-04-18 10:42:56

    Dynamic code application cannot be processed in Application. You need to apply at the exact location where you need to use it. It can be an activity or a Fragment. If the user refuses to provide permission, you can process it independently as needed and just do it in Application. Can't handle it anymore.

    reply
    0
  • PHPz

    PHPz2017-04-18 10:42:56

    Runtime permissions have been added after Android 6.0. For the adaptation plan, we recommend that you refer to the official demo: https://github.com/googlesamp...

    reply
    0
  • Cancelreply