Android 8. Launch my application and hide it immediately. After a few seconds, I get an error message:
startActivity called from finishing ActivityRecord{7497c34 u0 com.myproject..dev/com.myproject.activity.SplashActivity t-1 f}; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=com.myproject..dev/com.myproject.activity.RegistrationActivity }
Exception during pending activity launch pal=com.android.server.am.ActivityStackSupervisor$PendingActivityLaunch@a454565
java.lang.NullPointerException: Attempt to read from field 'android.content.Intent com.android.server.am.TaskRecord.intent' on a null object reference
at com.android.server.am.ActivityStarter.computeSourceStack(ActivityStarter.java:1425)
at com.android.server.am.ActivityStarter.startActivityUnchecked(ActivityStarter.java:983)
at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:953)
at com.android.server.am.ActivityStarter.doPendingActivityLaunchesLocked(ActivityStarter.java:1964)
at com.android.server.am.ActivityManagerService$MainHandler.handleMessage(ActivityManagerService.java:2055)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.os.HandlerThread.run(HandlerThread.java:65)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
This error is only on Android 8. In another version of Android, this error is not.
There is no link to a specific line in stacktrace (as you can see). Only the name of the activity ( SplashActivity ).
Here is my SplashActivity :
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
startActivity(new Intent(this, RegistrationActivity.class));
}
}
source
share