Caused by: java.lang.SecurityException: Need BLUETOOTH permission
来源:互联网 发布:淘宝上找同款 编辑:程序博客网 时间:2024/05/17 21:42
package com.m31bluetoothprinter.m31printerdemo;import android.bluetooth.BluetoothDevice;import android.os.Bundle;import android.support.v7.app.AppCompatActivity;import android.util.Log;import com.iprt.xzc_pc.android_print_sdk.BluetoothDiscover;import com.iprt.xzc_pc.android_print_sdk.BluetoothPrinter;import com.m31bluetoothprinter.m31printerdemo.Const.MacConst;public class MainActivity extends AppCompatActivity { private BluetoothDevice printer; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initDev(); } private void initDev() { printer = BluetoothDiscover.getPrinter(MacConst.BT_MAC); if(printer!=null){ printer.createBond(); } BluetoothPrinter bluetoothPrinter = new BluetoothPrinter(printer); Log.d("hlhtest", "initDev:getPrinter "+bluetoothPrinter.toString()); }}
配置文件中配置蓝牙权限
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/><uses-permission android:name="android.permission.BLUETOOTH"/>
0 0
- Caused by: java.lang.SecurityException: Need BLUETOOTH permission
- Caused by: java.lang.SecurityException: Permission Denif
- Caused by: java.lang.SecurityException: Permission Denial: reading com.androi...
- java.lang.SecurityException: Need BLUETOOTH ADMIN permission: Neither user 10047 nor current process
- java.lang.SecurityException: Need BLUETOOTH_PRIVILEGED permission:
- 【Android死丢丢】Caused by: java.lang.SecurityException: Permission denied (missing INTERNET permission?)
- Caused by: java.lang.SecurityException: Permission Denial: opening
- Caused by: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.int
- Caused by: java.lang.SecurityException: Permission Denial: starting Intent 崩溃报错的解决
- Caused by: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.int
- 项目报错:Caused by: java.lang.SecurityException:
- java.lang.SecurityException: Permission Denial
- 异常java.lang.SecurityException: You need MANAGE_USERS permission to……
- 推送报 java.lang.SecurityException You need MANAGE_USERS permission to check
- Caused by: java.lang.SecurityException: Jurisdiction policy files are not signed by trusted signers!
- spring Caused by: java.lang.SecurityException: Prohibited package name: java.time
- Caused by: java.lang.SecurityException: Prohibited package name: java.util.xsd
- Caused by: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadP
- 谁创造了硅谷?仙童半导体“叛逆八人”
- 年初随笔
- 安卓逆向系列教程(二)APK 和 DEX
- cascade级联操作及属性介绍
- hibernate注释
- Caused by: java.lang.SecurityException: Need BLUETOOTH permission
- 部分手机虚拟键盘的适配问题
- 炉石传说 疯狂爆破者空场炸死2个精灵龙的概率
- ELASTICSEARCH集群压测操作步骤
- 建造者模式(11)
- <<《Spark商业案例与性能调优实战100课》第17课:商业案例之NBA篮球运动员大数据分析系统代码实战
- 春节特辑 C1 E0 : Introduction
- 求数列的和 (sdut oj)
- Android 逆向工程 实践篇