Lesson 2 - How to add back button to the new screen





  • Go to androidmanifest.xml
  • under your second activity where you want back button
  • add android:parentActivityName= ".MainActivity"   /> closing statement


OR

  • delete the above code and use this method if you want to
  • go to second.java under OnCreate add
  • getSupportActionBar().setDisplayHomeAsUpEnabled(true);

Previous
Next Post »

1 comments: