How to close activity and go back to previous activity in android

后端 未结 18 1850
孤独总比滥情好
孤独总比滥情好 2020-12-07 08:19

I have a main activity, that when I click on a button, starts a new activity, i used the following code to do so:

Intent intent = new Intent(this, SettingsAc         


        
18条回答
  •  半阙折子戏
    2020-12-07 08:43

    I believe your second activity is probably not linked to your main activity as a child activity. Check your AndroidManifest.xml file and see if the entry for your child activity includes a android:parentActivityName attribute. It should look something like this:

    
    ...
    
    
    
    
    ...
    

提交回复
热议问题