use of android.support.design.widget.CoordinatorLayout in project PermissionsSample by CesarValiente.
the class BaseActivity method showSnackBarPermissionMessage.
protected void showSnackBarPermissionMessage(int message) {
final CoordinatorLayout coordinatorLayout = (CoordinatorLayout) findViewById(R.id.main_coordinator_layout);
Snackbar snackbar = Snackbar.make(coordinatorLayout, getString(message), Snackbar.LENGTH_LONG).setAction(getString(R.string.snackbar_settings), new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.parse("package:" + BuildConfig.APPLICATION_ID));
startActivity(intent);
}
});
snackbar.show();
}
Aggregations