我試圖發起AA電話中Broadcast.At的情況下,我從廣播receiver.In的的onReceive()方法的活動我使用這個意圖從廣播接收器啓動電話?
Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel"+num));
callIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
con.startActivity(callIntent);
調用另一個活動的瞬間問題在於啓動後立即斷開呼叫。 我對Galaxy Nexus的4.1.1嘗試這一點,我用下面的權限:
<uses-permission android:name="android.permission.CALL_PHONE" />
我是一個初學者到Android任何幫助將受到歡迎。
在呼叫自動結束這來自於logcat的:
ActivityManager(387): START u0 {act=android.intent.action.CALL dat=tel:xxxxxxxxxxxxx flg=0x10000000 cmp=com.android.phone/.OutgoingCallBroadcaster} from pid 6329
I/ActivityManager(387): START u0 {act=com.android.phone.SIP_SELECT_PHONE dat=tel:xxxxxxxxxxxxx flg=0x10000000 cmp=com.android.phone/.SipCallOptionHandler (has extras)} from pid 577
D/CallController(577): placeCall()... intent = Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxxxxxx (has extras) }
I/AudioService(387): AudioFocus requestAudioFocus() from AudioFocus_For_Phone_Ring_And_Calls
E/audio_hw_primary(131): Entering IN_CALL state, in_call=0
E/audio_hw_primary(131): Opening modem PCMs
I/LocalDevicePlayback(6366): pause: transient=false, currentPos=-1
D/PhoneUtils(577): placeCall()... number: xxxxxxxxxxxxx, GW: null, emergency? false
<使用許可權的android:NAME = 「android.permission.CALL_PHONE」/> – omar
請張貼的logcat日誌... –
你碰巧找到解決辦法?我遇到同樣的問題 – javaLovah