-3
如何從三星10.1 Android平板電腦撥打電話?該平板電腦支持迷你SIM卡,2G和3G網絡。不過,我可以在平板電腦上收到短信,但我無法撥打電話。當我想在我的應用內撥打電話時,我被重定向到添加新聯繫人。 (請注意,它工作正常進行從手機設備的呼叫!)這是我的代碼用於撥打電話:在你的OnCreate()打電話給三星10.1 Android平板電腦
public void onClick(View v) {
String destination = mContactsAt.getText().toString();
Log.d("CallActivity", "after getting the contact name");
String phoneNo = getPhoneNumber(destination);
Log.d("CallActivity", "after showing number");
if (phoneNo.startsWith("+")){
phoneNo.replace("+", "00");
}
phoneNo.replaceAll("[^0-9]+", "");
Log.d("CallActivity", "phoneNo to call =" + phoneNo + " destination " + destination);
phoneNumber = phoneNo;
contactName = destination;
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:"+phoneNo.trim()));
startActivity(intent);
}
您是否檢查平板電腦是否啓用了電話功能。 –
嗨,我查閱了關於啓用電話功能的教程,但是如果我可以在代碼中完成,我還會等待更多的反饋。這裏是教程,如果有人需要它:http://androidadvices.com/enable-phone-calling-feature-in-galaxy-tab-10-1-750-tutorial/ – Diana