cybero
21/02/15, 15:09:12
Hola a todos, estoy haciendo una app que nada más abrirla debe activar el bluetooth.
Pues bien, cuando abro mi app me pregunta si quiero activarlo y me sale esto:
http://i62.tinypic.com/23vm6a9.png
Realmente me gustaría que se activara automáticamente como hacen otras app, por ejemplo tengo esta app BTInterface free trial BETA (https://play.google.com/store/apps/details?id=com.btinterface.trial.beta&hl=es) que nada más abrirla activa el bluetooth sin preguntar.
Alguien sabe como podría hacerlo?
Por si sirve de ayuda dejo el código donde muestro como activo el Bluetooth:
private BluetoothAdapter BA;
BA = BluetoothAdapter.getDefaultAdapter();
if (!BA.isEnabled()) {
Intent turnOnIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(turnOnIntent, 0);
}
Pues bien, cuando abro mi app me pregunta si quiero activarlo y me sale esto:
http://i62.tinypic.com/23vm6a9.png
Realmente me gustaría que se activara automáticamente como hacen otras app, por ejemplo tengo esta app BTInterface free trial BETA (https://play.google.com/store/apps/details?id=com.btinterface.trial.beta&hl=es) que nada más abrirla activa el bluetooth sin preguntar.
Alguien sabe como podría hacerlo?
Por si sirve de ayuda dejo el código donde muestro como activo el Bluetooth:
private BluetoothAdapter BA;
BA = BluetoothAdapter.getDefaultAdapter();
if (!BA.isEnabled()) {
Intent turnOnIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(turnOnIntent, 0);
}