Last active
April 18, 2017 20:21
-
-
Save kmerrell42/df76f105a94eec8e562a16d423fd146f to your computer and use it in GitHub Desktop.
Ask for permission when "Next" button is clicked
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LaunchActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
... | |
findViewById(R.id.next_btn).setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
ActivityCompat.requestPermissions(LaunchActivity.this, | |
new String[]{Manifest.permission.RECEIVE_SMS}, | |
REQUEST_CODE_READ_SMS); | |
} | |
}); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment