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,292
  • 1
  • 22
  • 28
Edvard Åkerberg
  • 2,041
  • 1
  • 24
  • 42

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
  • 553
  • 4
  • 15