I have an app that only has 1 activity but have 4 fragments. For example,
My 1st fragment has a button, if I press the button, the textview's text will change to "test1" and when i go to the 2nd fragment, then go back to 1st fragment, the textview in the 1st fragment gets back to it's default value which is "New Text". But I already pressed the button so that the textview's text will change to "test1" right? How do I save a fragment's state like how I left it? For whoever will answer this, can you please give a sample code and explain it so it will make sense to me. Thank you and I hope I will learn something.