Software Engineering Stack Exchange is a question and answer site for professionals, academics, and students working within the systems development life cycle who care about creating, delivering, and maintaining software responsibly. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Problem: I have an object mBluetoothGatt (of BluetoothGatt type of course) in com/example/android/bluetoothlegatt/BluetoothLeService.java

which I want to use in com/example/android/bluetoothlegatt/DeviceControlActivity.java

I figure I can do it in the following 2 ways: 1. try to refer to mBluetoothGatt in its home-file, which appears to be something JAVA purposely prohibits, something I personally find insulting.

  1. Create a new "mBluetoothGatt1" object, or instance, and make sure it "points" to the same piece of hardware implementation (register, RAM address whatever) . And to my limited understanding of java, you can create something based on some sort of "context", which would be mighty convenient. If only there were some sort of constructor overloading for BluetoothGatt that allows me to use "context" as input...

So... help?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.