简体   繁体   English

android studio 2.2应用程序:getSystemService(Context.TELEPHONY_SERVICE)崩溃

[英]android studio 2.2 application: getSystemService(Context.TELEPHONY_SERVICE) crash

Android Studio 2.2 application 15-23: Android Studio 2.2应用程序15-23:
getSystemService(Context.TELEPHONY_SERVICE) getSystemService(Context.TELEPHONY_SERVICE)
crashes on NOTE_5 android 6.00 device . NOTE_5 android 6.00设备上崩溃。 works fine on various number of other device types. 在各种其他设备类型上都能正常工作。 Any ideas? 有任何想法吗?

Make sure you have this in your manifest: 确保清单中包含以下内容:

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

and that you are reqeuesting the permission at runtime. 并且您在运行时需要许可。 Check this out for more information. 查看以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM