Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RuntimePermissionChecker

taptappun
February 22, 2018

 RuntimePermissionChecker

RuntimePermissionCheckerというAndroidのライブラリを作成したのでその紹介。

taptappun

February 22, 2018
Tweet

More Decks by taptappun

Other Decks in Technology

Transcript

  1. ൓লΛ౿·͑ͯɺ͍࣮͟૷!! if(Build.VERSION.SDK_INT >= 23) { requestPermissions(new String[]{"android.permission.CAMERA"}, 0); } @Override

    public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { switch (requestCode) { case 0: { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){ Log.i("permission", "permitted"); } else { Log.i("permission", "not permitted"); } break; } } }