我正在尝试在本地拨出呼叫者屏幕顶部启动我的自定义屏幕,该屏幕可能包含呼叫者的全屏图像和一些用于拒绝呼叫等操作的按钮。使用它我可以拨打电话,但会将我重定向到本机呼叫者屏幕......
如何replace\override
通过我的自定义屏幕屏幕来默认呼叫屏幕?
startActivity(new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phonenumber)));
public class GetOutgoingNUmber extends BroadcastReceiver {
final static String INTENT_PHONE_NUMBER = "android.intent.extra.PHONE_NUMBER";
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Log.v("DileBroadCastReceiver","In onReceive()");
if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent i = new Intent(context, OutGoingScreen.class);
i.putExtras(intent);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
context.startActivity(i);
}
}, 1000);
}
这里 OutGoingScreen 用于显示传出屏幕
public class OutGoingScreen extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.outgoingscreen );
}
}
现在的问题是它显示我的屏幕几毫秒并再次显示本机屏幕......?