Intent intent = new Intent(Intent.ACTION_CALL);
을 사용하여 응용 프로그램에서 전화를 겁니다.intent.ACTION_CALL을 중지하는 방법을 한 번 시작 했습니까?
일정 기간 후에 전화를 거는 방법이 있습니까? 또는 ACTION_CALL 타이머를 시작하기 전에 설정하십시오.
Prasanta의 블로그에서 아래 코드를 사용하고 있습니다. 그러나 어떤 이유로 인해 context
에서 오류가 발생합니다. 어떤 제안?
은 귀하의 질문은 여러 번 요청되었습니다
import java.lang.reflect.Method;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.RemoteException;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.TextView;
import android.widget.Toast;
import com.android.internal.telephony.ITelephony;
public class AnswerActivity extends Activity {
private static final String TAG = null;
/** Called when the activity is first created. */
private ITelephony telephonyService;
TelephonyManager telephonyManager;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TelephonyManager tm = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);{
try {
// Java reflection to gain access to TelephonyManager's
// ITelephony getter
Log.v(TAG, "Get getTeleService...");
Class c = Class.forName(tm.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
com.android.internal.telephony.ITelephony telephonyService =
(ITelephony) m.invoke(tm);
} catch (Exception e) {
e.printStackTrace();
Log.e(TAG,
"FATAL ERROR: could not connect to telephony subsystem");
Log.e(TAG, "Exception object: " + e);
}
}
}
}
이 게시물을 참조하십시오. http://stackoverflow.com/questions/599443/android-how-to-hang-up-outgoing-call –
@MoshErsan 감사합니다. 해당 게시물을 읽었지만 구현할 수 없습니다. 문맥을 해결할 수 없습니다. 오류 – Parksie
여기를 작성하려면 –