android intent for sdcard ready
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an application that uses a file on the SD card, the application runs when the phone boots, and it has become apparent that the file cannot be accessed when the program is first run as it starts working before SD card is avaliable. Is there an broadcast receiver I can use to tell when the SD card is ready? Update Just to summarise the answer to register the intent do: IntentFilter filter = new IntentFilter (Intent.ACTION_MEDIA_MOUNTED); filter.addDataScheme("file"); registerReceiver(this.mSDInfoReceiver, new IntentFilter(filter)); and