Browsed by
Category: runtime-permission

Android multiple runtime permission

Android multiple runtime permission

Step -1 : Add the permissions on Menifest. Step 2 : Request for permissions Step 3: Check permissions Step 4 : Call it on OnCreate to check permissions are granted or not. Full Code import android.Manifest;import android.app.Activity;import android.content.Context;import android.content.DialogInterface;import android.content.pm.PackageManager;import android.os.Build;import android.os.Bundle;import android.support.design.widget.FloatingActionButton;import android.support.design.widget.Snackbar;import android.support.v4.app.ActivityCompat;import android.support.v4.content.ContextCompat;import android.support.v7.app.AppCompatActivity;import android.support.v7.widget.Toolbar;import android.view.View;import android.view.Menu;import android.view.MenuItem;import android.widget.Button;import android.widget.Toast; import android.app.AlertDialog;public class MainActivity extends AppCompatActivity { private static final int MY_PERMISSIONS_REQUEST_CODE = 123; private Context mContext; private Activity mActivity; private Button permissionCheck; @Override protected void onCreate(Bundle…

Read More Read More