Skip to content

Instantly share code, notes, and snippets.

Dave Park DaveNOTDavid

Block or report user

Report or block DaveNOTDavid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@DaveNOTDavid
DaveNOTDavid / ext_strge_prmns_sample.txt
Last active Feb 28, 2017
Requesting/granting in-app external storage permissions for devices Marshmallow (6.0/API 23) and above for a sample music player app (https://code.tutsplus.com/tutorials/create-a-music-player-on-android-project-setup--mobile-22764)
View ext_strge_prmns_sample.txt
/**
* Code snippet for requesting/granting permissions properly for dangerous permissions
* such as external storage for devices M (6.0/API 23) and above. For sampling purposes,
* snippet includes only the onCreate() and onRequestPermissionsResult() methods within
* MainActivity.
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
You can’t perform that action at this time.