I m 开发者_如何学JAVAworking on an auto start application. In my application when app starts i need to get the sim number. When i have not applied any sim lock my app is working fine but when i apply sim lock and again reboot the device it asks for the sim password and as soon as screen comes my auto start app gets crashed with null pointer exception.
How can i overcome this issue..
Detect whether the TelephonyManager
returns null when you query the IMSI (which is does when the SIM is not in state READY).
Then either schedule an alarm to check later, or listen for phone state or network events that indicate that the SIM has been unlocked.
精彩评论