How do you create a back button in the top left corner that allows you to go to the previous activity in android?
Found an answer here at https://stackoverflow.com/questions/14545139/android-back-button-in-the-title-bar
Need to add these methods
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; } return super.onOptionsItemSelected(item); }
public boolean onCreateOptionsMenu(Menu menu) { return true; }
And put this line in the oncreate method getSupportActionBar().setDisplayHomeAsUpEnabled(true);
I would think just drag the button to the top?