문제

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top