Home » Android » android – Preventing USSD dialog and read USSD response. (year 2020 Solution)-Exceptionshub

android – Preventing USSD dialog and read USSD response. (year 2020 Solution)-Exceptionshub

Posted by: admin February 26, 2020 Leave a comment

Questions:

Follow the top rated answer from this link:
Prevent USSD dialog and read USSD response?

Then add this piece of code in your MainActivity.java under the onCreate section:

Intent openSettings = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
openSettings.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(openSettings);

Once you run your app, the phone will ask you to set the Accessibility setting of your installed app to ON.
If it doesn’t, then manually go to your phone’s settings, under the Accessibility section, set it to ON.

How to&Answers: