开发者

Android app crashes when sim is locked

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜