0
我想打開代碼*#9900#的Dial Intent。但是電話應用程序總是顯示爲空。如何運行意向呼叫號碼*#9900#
這裏是我的代碼:
public void limpiarLogCat(View view) {
String encodedHash = Uri.encode("#");
call("*" + encodedHash + "9900" + encodedHash);
}
protected void call(String phoneNumber) {
try {
startActivityForResult(
new Intent("android.intent.action.DIAL", Uri.parse("tel:"
+ phoneNumber)), 1);
} catch (Exception eExcept) {
}
}
而且,我在的manifest.xml宣佈android.permission.CALL_PHONE
。
你能幫我嗎?
謝謝Basbous,我已經在我的清單中聲明瞭這一點。但該方法不起作用。問候 – user3651769
@ user3651769查看更新的答案 – Basbous
謝謝Basbous,您的方法與Uri.encode(「* 9900#」)一起使用,但不適用於Uri.encode(「*#9900#」)。問候 – user3651769