好的。我发现很难说清楚。让我试试。
我正在使用广播接收器来为每个呼叫调用。
<receiver
android:name="com.example.receiveCall"
android:enabled="true" >
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
</receiver>
在 onReceive 方法中,我在顶部开始了一个活动。
@Override
public void onReceive(final Context context, Intent intent) {
Handler mHandler = new Handler();
AttendActivity.ctx = context;
Runnable mUpdateTimeTask = new Runnable() {
public void run() {
// do what you need to do here after the delay
// context.startService(new Intent(context, AutoAnswerIntentService.class));
context.startActivity(new Intent(context,
AttendActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
};
mHandler.postDelayed(mUpdateTimeTask, 500);
}
}
当应用程序不可见时,这可以正常工作。但是当应用程序可见时。我的活动在 InCallScreen 顶部打开。但是当我关闭参加活动时。而不是 InCallScreen 我的应用程序是可见的。Incallscreen 就在它上面。
你能帮我解决这个问题吗?期望的输出
MyApp -> InCallScreen -> AttendActivity
当前输出 InCallScreen -> MyApp -> AttendActivity