Mohd Asif Ahmed :
I am trying to open Sound settings from my app
startActivity(new Intent(Settings.ACTION_SOUND_SETTINGS));
Sound Settings Activity displays without any issue.
Scenarios After Opening Sound settings page
- When I press back button on my device, it is going back to my application.
- when I click on back arrow button(top left), it is going to Settings Main Screen.
Issue:
I want to go back to my app when click on back icon also.
startActivityForResult(new Intent(Settings.ACTION_SOUND_SETTINGS), 100);
I have also tried this. but no result.
I am testing this on OnePlus 6 (Android 10 (Q))
Septimiu :
Create an intent: Intent intent = new Intent(Settings.ACTION_SOUND_SETTINGS);
Add these lines to your intent:
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
then call startActivity(intent);