Here is a brief introduction to the situation I have encountered, because the situation is very special, so I would like to record my experience in this area!
Cause: In my app there is a video playback function, because of the previous optimization, I heard that for the video such a more resource-intensive should give him a process alone. This will make the app more fluid. Then I did as I did, giving the video player a process to open up alone! Then that means that there are two processes in my app, one is the default process, and the other is the one I've specified. You then have the ability to comment on the video at the bottom of the video playback page. Others can also comment on the video to the person to reply, like and other actions. However, the premise is that users who have commented on the video reply, like the action must be the user has signed in to the app, as the current user (I am logged on whether the user using Sharedpreference.gettoken () is empty to judge, because when the user login successful, I will use Sharedpreference.savetoken () to store the user's login record). So, follow this idea. I went to the video playback page (I didn't log in at this point) and liked the user who already rated the video. Since I am not logged in the user to do the operation, through Sharepreference.gettoken () to determine the empty, then I was forced to enter the landing page, and then after the successful landing. Operation again like, the results unexpectedly happened! I can't get storage records that have been successfully logged on.
Later, I went through a variety of attempts. Verify that it is not my parameter or what is wrong with the method. After a whole day to find out the original is two independent process problems! I try to verify during the browsing process if I am in the default process and then go to the video playback page. On the playback page, you can still get the record of successful login via Sharedpreference.gettoken (). But if I was in the second independent process, the playback page is logged in to store a successful login record. Then, even after the storage succeeds, the stored record data cannot be acquired immediately, and the obtained data is empty.
My solution is to unify a process app.
No instant access to data after using Sharedpreferences instant storage