Hello my friends,this is Steven’s blog.In here I will share some interesting findings on the road of learning computer science.
Recently,I have learned some framework of Android studio,and I come up with an idea of creating a program that can open another Activity and return to the previous Activity through a button.
But as I open the second Activity and click the “back” button,I don’t get back to the first Activity but return to the home page!
But as I open the second Activity and click the “back” button,I don’t get back to the first Activity but return to the home page!
The problem occurs on the switch code .
To solve this problem,I comment out the switch and the onclick attribute to the xml file ,then add private click listener to every button respectively.Then the problem is solved.