should Show Request Permission Rationale - Android android.app

Android examples for android.app:Permission

Description

should Show Request Permission Rationale

Demo Code

import android.annotation.TargetApi;
import android.app.Activity;
import android.app.Fragment;
import android.content.pm.PackageManager;
import android.support.v13.app.FragmentCompat;
import android.support.v4.app.ActivityCompat;
import android.util.Size;
import android.view.Surface;

public class Main{

    public static boolean shouldShowRequestPermissionRationale(
            Fragment context, String[] permissions) {
        for (String permission : permissions) {
            if (FragmentCompat.shouldShowRequestPermissionRationale(
                    context, permission)) {
                return true;
            }//from   ww  w  . j  av  a  2s. c  o  m
        }
        return false;
    }

}

Related Tutorials