问题
I am getting reports from several users of an Android application I developed that after restarting their device, the widget disappears from the home screen and cannot be found in the list of widgets. After uninstalling the application and reinstalling it, widgets reappear, until the next restart. It looks like the problem happened after an update of the Android version on the devices that report the problem. Does anyone know what could the problem be?
回答1:
It looks like the problem occurs on devices running Android M that also have an SD card emulated as internal storage. What happens during reboot is that the system moves applications onto the SD card and this seems to be causing the problem. I will try adding the internalOnly flag in the Manifest and this should fix the problem.
来源:https://stackoverflow.com/questions/41924847/widgets-disappearing-after-device-restart