Package Installer crashes in Android M after requesting permission READ_SMS
问题 I have a Login Fragment that tries to access (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE); this works well with devices up to Lollipop 5.1. And when I tried it in Marshmallow 6.01 it showed security exception. So I added code from android docs to request permission on runtime. Here is the code int permissionCheck = ContextCompat.checkSelfPermission(getActivity(),Manifest.permission.READ_SMS); if (permissionCheck != PackageManager.PERMISSION_GRANTED) { // Should