I've recently installed JDK 7 SE and Android SDK 1.13 along with Eclipse IDE
for Java development v20090619-0625
In my first project, I'm trying to use
BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED, but the interpreter in
Eclipse says it cannot be resolved.
I have code as:
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothReceiver;
public class BtReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
String action = intent.getAction();
if (action.equals(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED))
{
int currentConnState =
intent.getIntExtra(BluetoothAdapter.EXTRA_CONNECTION_STATE,
BluetoothAdapter.STATE_DISCONNECTED);
}
}
}
Red is unresolved errors.
The docs specify these as defined strings for BluetoothAdapter.
What am I doing wrong? Wrong version?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en