fire an intent from the onCreate method in android
-
26-09-2019 - |
문제
Maybe my question might seem a bit weird, but I have an activity in which, in one case , I have to move to another activity before it finishes loading the screen. My condition is in the onCreate method, which means when I encounter it, i get a "startActivity called from outside an activity context" error and the app just crashes...
But then, is there an easy way like a flag for the intent to make it work without having the activity context resolved?
thanks for any answer
해결책
I dont think it's possible to switch to another activity during the onCreate method of a starting activity. But why you just doesn't draw any GUI before deciding if you have to start the other activity?
제휴하지 않습니다 StackOverflow