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);  
}
Kayhan Asghari
  • 2,817
  • 1
  • 28
  • 47
Smitha
  • 6,110
  • 24
  • 90
  • 161

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,049
  • 5
  • 49
  • 66