昨天參照了網(wǎng)上寫(xiě)了一段手機(jī)間藍(lán)牙傳輸?shù)拇a,按 Ctrl+C 復(fù)制代碼ContentValues cv = new ContentValues();String uri = "file://"+ mSendFileNameTV.getText().toString().trim();cv.put("uri", uri);cv.put("destination",mTouchObject.bluetoothDevice.getAddress());cv.put("direction", 0);Long ts = System.currentTimeMillis();cv.put("timestamp", ts);可是運(yùn)行到下面這行代碼就報(bào)錯(cuò)了getContentResolver().insert(Uri.parse("content://com.android.bluetooth.opp/btopp"),cv);看了下logcat的信息顯示java.lang.SecurityException: Permission Denial: writing com.android.bluetooth.opp.BluetoothOppProvider uri content://com.android.bluetooth.opp/btopp from pid=10194, uid=10056 requires android.permission.ACCESS_BLUETOOTH_SHARE, or grantUriPermission()這個(gè)是什么原因造成的錯(cuò)誤?有解決的方法么?
android手機(jī)開(kāi)發(fā)藍(lán)牙傳輸問(wèn)題,求幫忙
BIG陽(yáng)
2018-11-03 14:18:35