1

I have a requirement where I want to develop a hybrid application and list the Bluetooth devices, scan and connect, share files etc.

So I want to add BluetoothAdapter mAdapter value into extras and pass it into onActivity result. Like enableIntent.putExtra("", mAdapter); and use it in onActivityResult by getExtra(...). Is there a way to do so??..

if (!mBluetoothAdapter.isEnabled()) {  
    Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);  
    ((Activity)context).startActivityForResult(enableIntent, RequestCodes.BLUETOOTH_ENABLE_CODE);  
}
Keyhan Asghari
  • 2,779
  • 1
  • 26
  • 47
Smitha
  • 6,038
  • 20
  • 89
  • 155

1 Answers1

1

Why don't you use Application class to store that data and use wherever you need.

Check this post for how to use Application class.

Community
  • 1
  • 1
Venky
  • 11,044
  • 5
  • 47
  • 66