我从其他一个android工程移植了一部分代码到我工程。
Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
///startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
现在发现一运行startActivityForResult就报错,android手机运行一下就马上自己关闭了. log调试信息:
Shutting down VM
FAIL EXCEPTION:main
java.lang.RuntimeException:Unable to resume activity{com.exaple.pedometer/
com.example.pedometer.MainActivity}:java.lang.SecurityException:Permission
......
请问这是怎么回事? 如何修改
Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
///startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
现在发现一运行startActivityForResult就报错,android手机运行一下就马上自己关闭了. log调试信息:
Shutting down VM
FAIL EXCEPTION:main
java.lang.RuntimeException:Unable to resume activity{com.exaple.pedometer/
com.example.pedometer.MainActivity}:java.lang.SecurityException:Permission
......
请问这是怎么回事? 如何修改
以下是APIDemo里面的部分内容:
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />前两个是访问通讯录得,其他自己查吧。