Java 正在停止未恢复的活动:{com.example.stopcall.app/com.example.stopcall.app.activities.MainActivity
我试图截获呼出的电话并打开一个弹出窗口Java 正在停止未恢复的活动:{com.example.stopcall.app/com.example.stopcall.app.activities.MainActivity,java,android,android-activity,fragment,roboguice,Java,Android,Android Activity,Fragment,Roboguice,我试图截获呼出的电话并打开一个弹出窗口 (接收器-->碎片活动-->弹出碎片) 我正在使用android的roboguice 但是,我的代码因以下错误而崩溃: 01-01 10:32:41.396 13265-13265/com.example.stopcall.app E/﹕ mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Fri Mar 21 13:52:50 KST 2014 01-01 10:32:41.931 13265-13265/com.
(接收器-->碎片活动-->弹出碎片)
我正在使用android的roboguice
但是,我的代码因以下错误而崩溃:
01-01 10:32:41.396 13265-13265/com.example.stopcall.app E/﹕ mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Fri Mar 21 13:52:50 KST 2014
01-01 10:32:41.931 13265-13265/com.example.stopcall.app E/ActivityThread﹕ Performing stop of activity that is not resumed: {com.example.stopcall.app/com.example.stopcall.app.activities.MainActivity}
java.lang.RuntimeException: Performing stop of activity that is not resumed: {com.example.stopcall.app/com.example.stopcall.app.activities.MainActivity}
at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3463)
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3550)
at android.app.ActivityThread.access$1200(ActivityThread.java:175)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1335)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5602)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
这是我的密码:
public class OutgoingCallReceiver extends RoboBroadcastReceiver {
public static final String ABORT_PHONE_NUMBER = "0055";
private static final String OUTGOING_CALL_ACTION = "android.intent.action.NEW_OUTGOING_CALL";
private static final String INTENT_PHONE_NUMBER = "android.intent.extra.PHONE_NUMBER";
@Override
protected void handleReceive(Context context, Intent intent) {
super.handleReceive(context, intent);
Intent i = new Intent(context, PopupActivity.class);
i.putExtra(Constants.DIALED_PHONE, phoneDal.getItem(phoneNumber));
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
setResultData(null);
}
及
当您启动
MainActivity
Activity时?这是启动器活动。为什么?正如日志中所述,MainActivity
Activity会出现问题
public class PopupActivity extends RoboFragmentActivity implements
YesNoDialogFragment.YesNoDialogFragmentListener {
@Inject PhoneDal phoneDal;
public Phone phone;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_main);
//
// btnEditName = (Button) findViewById(R.id.btn_edit);
// txtName = (TextView) findViewById(R.id.txt_name);
//
// btnEditName.setOnClickListener(this);
phone = getIntent().getParcelableExtra(Constants.DIALED_PHONE);
exportDatabase(Constants.DB_NAME);
showYesNoDialog();
}
// The dialog fragment receives a reference to this Activity through the
// Fragment.onAttach() callback, which it uses to call the following methods
// defined by the NoticeDialogFragment.NoticeDialogListener interface
@Override
public void onDialogPositiveClick() {
persistNumberIsAllowed();
SendDialIntent();
finish();
}
private void SendDialIntent() {
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel" + phone.phone));
startActivity(intent);
}