Home > Mobile >  Android. View. $BadTokenException WindowManager
Android. View. $BadTokenException WindowManager

Time:10-06


Application startup page has the network, and the data load failure bounced, has been sporadic at the fault, repetition is not found path, determine whether the Activity finish, whether to destroy, and getParent () tried to get is null, it is the feeling, please guidance

CodePudding user response:

Destroyed you page but I can't cancel the network request, this belongs to a memory leak

CodePudding user response:

Possibility is not big, the network before the results come back, no page jump, closed, destruction of operation, such as some start few seconds collapsed, and up to dozens of seconds

CodePudding user response:

I also met before, somehow the screen switch,
If you don't have to intercept the life cycle of a switch, or force in the vertical screen is the logic of the code you write, it is possible to appear this kind of problem,
The reason is that the Activity was first created hypothesis is landscape, you pop up a dialog, the user put up the screen, the Activity will be forced to destroy and rebuild destroyed but no dialog (specific reason pending investigation, all API have this problem), and then you dismiss, because of your dialog is attached to be destroyed before the Activity so will surely collapse

CodePudding user response:

We set up in the AndroidManifest android: screenOrientation="portrait"
  • Related