android - can't access SDCARD at the starting time of device in livewallpaper -
The wallpaper in which I am displaying data from the database, which is actually in the SD card
- firstly If I want to use data I have put some bet on sdcard
if (Environment.getExternalStorageState (.) Equals (Environment.MEDIA_MOUNTED)) { this is okay, now when I restart my device at the startup time of my device, then my wallpaper wants to access the database, so that It will first check the condition, but it will return FALSE It may be that the SD card has been mounted shortly after the start of the Android OS. .. So can someone suggest me how to solve this issue, because the large size database is to put on the SDCARD SDCARD < After / div>
It may be that Android has been installed after some time OS
Yes to register properly, so action. MEDMount The HeN SD-card has been mounted to receive broadcast recipient transmissions. The first register in AndroidManifest.xml is BroadcastReceiver:
& Lt; / Intent-Filter & gt; & Lt; / Receiver & gt; Do your work within the onReceive method in the ExternalStorageInfoReceiver:
Public Square ExternalStorageInfoReceiver extends BroadcastReceiver {@Override Public Zero onReceive (reference reference, intent meaning) { / / Change the wallpaper ....}}
Comments
Post a Comment