简体   繁体   English

我希望我的Android应用程序获取EditText值,然后加入#符号并拨打USSD代码 - 但它只是调用

[英]I want my Android App to get EditText value, then join # symbol to it and dial USSD code - but its just calling

I want my App to get TextView value add # sign to it and dial USSD code, but the program is just dialing normally and showing the full concatenated text included. 我希望我的应用程序获取TextView值为其添加#符号并拨打USSD代码,但该程序只是正常拨号并显示包含的完整连接文本。

I am using Android 2.0 我使用的是Android 2.0

//To request permission and this work fine, because of its dialing. But I want it to run USSD not dial
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
    if(requestCode == REQUEST_CALL){
        if(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){
            makeCall();
        } else {
            Toast.makeText(this, "permission Denined.", Toast.LENGTH_SHORT).show();
        }
    }
}

Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + uSSD +phone+'*'+Amount+NairaSign));
startActivity(intent);

Can you try the following code: Uri.parse("tel:" + uSSD+phone+"*"+Amount+Uri.encode(NairaSign)) NairaSign should have value "#" ie a string variable. 你能尝试下面的代码:Uri.parse(“tel:”+ uSSD + phone +“*”+ Amount + Uri.encode(NairaSign))NairaSign应该有值“#”即字符串变量。 make sure to use android.permission.CALL_PHONE in your manifest file. 确保在清单文件中使用android.permission.CALL_PHONE。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android Studio-在拨号盘中执行USSD代码 - Android Studio - Execute USSD code in Dial Pad 在Android中运行USSD代码并将应用程序保留在第一位 - Run USSD Code in Android and Keep the App in the firstground 我只想在我的 android 应用程序中更改操作栏的颜色 - I just want to change the color of my action bar in my android app 当我想在 sqlite 表中插入一个值时,当我在 editText 中添加引号时,我的应用程序不断崩溃如何解决这个问题? - when I want to insert a value into sqlite table my app keep crashing when I add quotation mark in editText How to fix this? 我想在Android中为6个edittext框制作函数,其中包括edittext的所有属性,以便我可以简单地调用function - i want to make function for 6 edittext boxes in android which includes all properties of edittext so that i can just simply call function 在 Android 中没有得到 USSD 代码的响应 - Not Getting Response of USSD Code in Android 我想重构我的代码以一次获取所有图像并将其映射到其在 JPA 中的 id - I want to refactoring my code to get all images at once and map it to its id in JPA 我想获取联系人姓名和电话号码,但是我的代码只是打印联系人姓名,所以我怎么也可以获取电话号码 - I want to get the contact name and number but my code just prints the contact name so how can I also get the number 我想在我的android应用程序中使用大整数,但是每当我应用运算符时,我都会出错? - I want to use big integer in my android app but when ever i apply operators i get error? 双变量从EditText获取其值 - Double variable get its value from EditText
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM