-1

I've been trying to restart the android application when I switch endpoints. I have Activity A (MAIN) -> Activity B -> Activity C. In Activity C, I switch my endpoint and call ProcessPhoenix.triggerRebirth(this);

This kills the app and launches Activity A, but I also see a FATAL NPE in the onCreate of Activity B. It happens to be coming from classes that I had injected into Activity B.

Why is onCreate and subsequently onCreateView of Activity B called?

I do see Activity A in the background behind the crash dialog though!

I have tried solutions in How to 'restart' an android application programmatically and the other links within that link. The result/behavior is the same.

Any ideas?

Community
  • 1
  • 1
sr09
  • 720
  • 5
  • 26

1 Answers1

0

I am not familiar with ProcessPhoenix.triggerRebirth(this) but if it is trying to rebuild the stack from Activity A -> B -> C, the standard Android lifecycle calls would be made and something NPE'd when it was needed.

Shazbot
  • 1,444
  • 1
  • 11
  • 21