Today, I encountered a bug in the project navigation framework, as shown in:
This bug is very strange. It is the first time that it is running. No matter how you click OK! However, when you exit and come in again, the above error will be reported when you click it! I found this on the Internet. There will be a strange way to make a mistake like this! However,This operation cannot be executed in onsaveinstancestate ()After"Is the same. This type of error is not common. It is equivalent to a large set of errors. There are many error reporting methods in it!
The following describes my errors:
Click any item on the left side of this slide so that the corresponding content of the item is displayed on the right side. I use broadcast to achieve this effect. After some effort, I learned that there were no errors when I first entered the system, but why was there an error for the second time ?? Error can not perform this action after onsaveinstancestate is caused by the fact that every time I exit for the second time, all the activities have been killed and recycled. However, the broadcast still exists and is always ready to accept the broadcast sent from him. Therefore, the method is called immediately after the current activity is K:Onsaveinstancestate (), and then performs the fragment inbound stack operation through broadcast;
Therefore, the solution is to register the broadcast in the ondestory () method of the activity that receives the broadcast;