开发者

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 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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜