Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Return to application from settings intent

In my applicattion i need to go to de settings activity of the phone whith the next code:

`Intent myIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(myIntent);´

Then in the settings activity, when the user press BACK key, i want to return to my applicattion ¿it's possible?

Thanks

like image 472
itaravika Avatar asked Feb 15 '26 00:02

itaravika


1 Answers

I think the reason is because you have put your code in onCreate() method. Try to movie it to onStart() method. Them when user click back button this method will be called.

For more info about activity life cycle please see this page

like image 137
Hesam Avatar answered Feb 17 '26 12:02

Hesam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!