Skip to content

Instantly share code, notes, and snippets.

@ar-android
Created November 9, 2017 03:06
Show Gist options
  • Save ar-android/c08304e2e9f9e0142c54a2e33ec483e7 to your computer and use it in GitHub Desktop.
Save ar-android/c08304e2e9f9e0142c54a2e33ec483e7 to your computer and use it in GitHub Desktop.
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>
private void setupToolbar() {
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar ab = getSupportActionBar();
if (ab != null) {
ab.setDisplayHomeAsUpEnabled(true);
ab.setHomeAsUpIndicator(R.drawable.ic_arrow_back_white);
ab.setTitle("");
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
break;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment