0

When I press the arrow back I want to navigate to my previous screen(where I came from). So if I'm in MainActivity and go to setting I want the arrow to point back to MainActivity, but if I'm in another Activity I want it to go back to that activity.

<activity
    android:name=".SettingsActivity"
    android:label="@string/action_settings"
    android:parentActivityName=".MainActivity" >
</activity>
Prasad
  • 3,462
  • 1
  • 23
  • 28
Edvard Åkerberg
  • 2,181
  • 1
  • 26
  • 47

1 Answers1

0

How do you start settings activity?

Just use startActivity(intent) in main activity and don't call finish() method. It should be handled automatically.

sample code:

Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
startActivity(intent);

just comment what's your problem exactly and I'll edit my answer.

Sina KH
  • 563
  • 4
  • 16