[英]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.