Skip to content

Most visited

Recently visited

navigation

TelephonyManager.UssdResponseCallback

public static abstract class TelephonyManager.UssdResponseCallback
extends Object

java.lang.Object
   ↳ android.telephony.TelephonyManager.UssdResponseCallback


Used to notify callers of sendUssdRequest(String, UssdResponseCallback, Handler) when the network either successfully executes a USSD request, or if there was a failure while executing the request.

onReceiveUssdResponse(TelephonyManager, String, CharSequence) will be called if the USSD request has succeeded. onReceiveUssdResponseFailed(TelephonyManager, String, int) will be called if the USSD request has failed.

Summary

Public constructors

TelephonyManager.UssdResponseCallback()

Public methods

void onReceiveUssdResponse(TelephonyManager telephonyManager, String request, CharSequence response)

Called when a USSD request has succeeded.

void onReceiveUssdResponseFailed(TelephonyManager telephonyManager, String request, int failureCode)

Called when a USSD request has failed to complete.

Inherited methods

From class java.lang.Object

Public constructors

TelephonyManager.UssdResponseCallback

added in API level 26
TelephonyManager.UssdResponseCallback ()

Public methods

onReceiveUssdResponse

added in API level 26
void onReceiveUssdResponse (TelephonyManager telephonyManager, 
                String request, 
                CharSequence response)

Called when a USSD request has succeeded. The response contains the USSD response received from the network. The calling app can choose to either display the response to the user or perform some operation based on the response.

USSD responses are unstructured text and their content is determined by the mobile network operator.

Parameters
telephonyManager TelephonyManager: the TelephonyManager the callback is registered to.

request String: the USSD request sent to the mobile network.

response CharSequence: the response to the USSD request provided by the mobile network.

onReceiveUssdResponseFailed

added in API level 26
void onReceiveUssdResponseFailed (TelephonyManager telephonyManager, 
                String request, 
                int failureCode)

Called when a USSD request has failed to complete.

Parameters
telephonyManager TelephonyManager: the TelephonyManager the callback is registered to.

request String: the USSD request sent to the mobile network.

failureCode int: failure code indicating why the request failed. Will be either USSD_RETURN_FAILURE or USSD_ERROR_SERVICE_UNAVAIL.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)