Settings.ACTION_SOUND_SETTINGS is not going back to app

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

  1. When I press back button on my device, it is going back to my application.
  2. 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);

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=7263&siteId=1