0

I'm letting users access the device Settings via a menu within my app:

Intent dialogIntent = new Intent(android.provider.Settings.ACTION_SETTINGS);
startActivity(dialogIntent);

However, once user is done with making changes in Settings, I need them to be able to return to my app. We made modifications to Android to remove the soft buttons, so using the standard back button is a no-go.

Is there a way to enable the standard back button to go back in history or to go up from Settings back to my app?

Thanks!

Chuender
  • 103
  • 9
  • Why don't you re enable soft buttons before startActivity and on onResume disable them again? – Pedro Oliveira Sep 24 '14 at 10:08
  • Is there a way to just enable the back button? – Chuender Sep 25 '14 at 00:57
  • An update: I'm now using startActivity(new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK)); which displays the wifi picker screen of the Settings app with the up navigation in the actionbar. However, when I click the up navigation it brings me to the Settings main activity as opposed to back to my app. Can this behavior be changed? – Chuender Sep 25 '14 at 03:35

1 Answers1

0

Calling finish() from the second activity should return you to the previous one (unless you have used android:noHistory = "true" in the manifest). In case you want to take back some data from the second activity to the first one, you can use startActivityForResult instead. You can read more about the latter idea here, if you need.

Developer.Android link to startActivityForResult

Edd
  • 1,350
  • 11
  • 14
  • I'm trying to get away from changing Android's Settings app, which is the external app I'm starting from my own app. – Chuender Sep 25 '14 at 00:57
  • Have you then considered reactivating the soft buttons (which are an important element in controlling the life cycle of the activity and shouldn't be messed with, in my opinion) just when you want the user to go to the android settings? You can then hide them again when you get back in your app. – Edd Sep 25 '14 at 08:55