1
なぜbrodcast reciverの登録がnullを返すのかを知ることができますか? これはコードである:フィルタリングするために受信者を登録できません。
ScoIntent = new IntentFilter(BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED);
sReceiver = new ScoReceiver(context, Tmp);
if (context.registerReceiver(sReceiver, ScoIntent) == null) {
Log("FBR.GetBlueConnect:Error", "Can not find receiver ACTION_CONNECTION_STATE_CHANGED");
HFS.DisplayText("Can not connect to Bluetooth Headset, Please Exit", true);
}
これはreciverある:
class ScoReceiver extends BroadcastReceiver {
public ScoReceiver(Context mcontext, Tools t){
bContext = mcontext;
tools = t;
}
@Override
public void onReceive(Context context, Intent arg1) {
tools.Log("ScoReceiver:onReceive", "In");
//arg1 = new Intent(AudioManager.ACTION_SCO_AUDIO_STATE_UPDATED);
String action = arg1.getAction();
tools.Log("ScoReceiver:onReceive", ">>> Bluetooth SCO state changed !!! ");
if(BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED.equals(action)) {
int status = arg1.getIntExtra(BluetoothHeadset.EXTRA_STATE, AudioManager.SCO_AUDIO_STATE_ERROR);
}
ですdeveloper.android.com/reference/android/bluetooth/BluetoothHeadset.html)は、アトマー機能の中ではっきりと言及されている粘着性でないbrodcastインテントに関するものです。 –
http://developer.android.com/reference/android/bluetooth/BluetoothHeadset.htmlこれは:ACTION_CONNECTION_STATE_CHANGED –
私は完全に混乱しています –