Using IExtendedNetworkService to get USSD response in Android

前端 未结 1 1074
遇见更好的自我
遇见更好的自我 2020-12-28 23:29

I\'m trying to find the way to make USSD requests in Android. I found this - http://commandus.com/blog/?p=58 . I added all needed files to my project.

USSDDumbExtend

相关标签:
1条回答
  • 2020-12-28 23:48

    Well, I have found the answer.

    I just put the link on my gist.

    Deactivate messages

    USSDDumbExtendedNetworkService.mActive = false;
    

    Send USSD:

    Intent launchCall = new Intent(Intent.ACTION_CALL,
                            Uri.parse("tel:" + Uri.encode(ussdcode)));
    launchCall.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    launchCall.addFlags(Intent.FLAG_FROM_BACKGROUND);
    startActivity(launchCall);
    

    Activate messages again

    USSDDumbExtendedNetworkService.mActive = true;
    USSDDumbExtendedNetworkService.mRetVal = null;
    
    0 讨论(0)
提交回复
热议问题