fire an intent from the onCreate method in android
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 fini开发者_StackOverflow社区shes 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 answerI 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?
精彩评论