java.lang.NullPointerException
at android.view.ViewGroup.dispatchCancelPendingInputEvents(ViewGroup.java:3405)
at android.view.ViewGroup.dispatchCancelPendingInputEvents(ViewGroup.java:3405)
at android.view.ViewGroup.dispatchCancelPendingInputEvents(ViewGroup.java:3405)
at android.view.ViewGroup.dispatchCancelPendingInputEvents(ViewGroup.java:3405)
at android.view.ViewGroup.dispatchCancelPendingInputEvents(ViewGroup.java:3405)
at android.view.ViewGroup.dispatchCancelPendingInputEvents(ViewGroup.java:3405)
at android.view.View.cancelPendingInputEvents(View.java:13591)
at android.app.Activity.startActivityForResult(Activity.java:3554)
at android.app.Activity.startActivityForResult(Activity.java:3493)
at android.app.Activity.startActivity(Activity.java:3735)
at android.app.Activity.startActivity(Activity.java:3703)
at com.example.mobile.dt.startActivity(PActivity.java:223)
at com.example.mobile.label.SplashActivity.d(SplashActivity.java:280)
at com.example.mobile.label.SplashActivity.b(SplashActivity.java:266)
at com.example.mobile.label.SplashActivity.c(SplashActivity.java:512)
at com.example.mobile.label.SplashActivity.b(SplashActivity.java:446)
at com.example.mobile.label.y.run(SplashActivity.java:388)
at java.lang.Thread.run(Thread.java:841)
我正在创建一个继承自BaseActivity的ChildActivity。当我尝试调用startActivity(intent)时会发生以下情况。
SplashActivity(Child)
public void openLoginActivity() {
Intent intent = new Intent(this, com.example.mobile.LoginActivity.class);
startActivity(intent);
finish();
}
在BaseActivity中
@Override
public void startActivity(Intent intent) {
super.startActivity(intent);
}
这是在SplashActivity中调用的代码:388,我正在调用StatusResponse(PResponse)。
private void StatusResponse(Response response) {
JSONObject jsonResponse = response.response;
if (jsonResponse == null) {
restart();
return;
} else {
try {
openLoginActivity();
} catch (JSONException ex) {
restart();
return;
}
}
}
有时候它会抛出异常,我不确定为什么会这样。
有人能帮帮我吗!!!
startActivity
? - mapodev