08-22 15:33:41.782 1053-1121/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!
08-22 15:33:41.782 1053-1121/? W/BroadcastQueue: Failure sending broadcast Intent { act=com.android.smartphone.SmartphoneSystemActivity flg=0x10 (has extras) }
android.os.TransactionTooLargeException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:502)
at android.app.ApplicationThreadProxy.scheduleRegisteredReceiver(ApplicationThreadNative.java:1104)
at com.android.server.am.BroadcastQueue.performReceiveLocked(BroadcastQueue.java:520)
at com.android.server.am.BroadcastQueue.deliverToRegisteredReceiverLocked(BroadcastQueue.java:610)
at com.android.server.am.BroadcastQueue.processNextBroadcast(BroadcastQueue.java:721)
at com.android.server.am.BroadcastQueue$BroadcastHandler.handleMessage(BroadcastQueue.java:179)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
我在互联网上搜索过,有人说是因为传输数据超过1Mb,或者有人使用Bitmap等等。但是我传递的数据不是那么大而且没有图片,而且起初数据可以传输,所以我不知道哪里出错了,附上我的密钥代码:
关于发送广播:
Intent intent = new Intent("com.android.smartphone.SmartphoneSystemActivity");
intent.putExtra("4_ch_data", EEG_data);
sendBroadcast(intent);
关于接收器广播:
public class newStress extends Activity implements OnClickListener
{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.newstress);
Display display = this.getWindowManager().getDefaultDisplay();
msgReceiver = new MsgReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("com.android.smartphone.SmartphoneSystemActivity");
registerReceiver(msgReceiver, intentFilter);
}
public class MsgReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
int[] data = new int[4];
double[] ddata = new double[4];
int i;
data = intent.getIntArrayExtra("4_ch_data");
for (i = 0; i < 4; i++) {
ddata[i] = (double) (data[i]);
if (ddata[i] <= 8388607) {
ddata[i] = ((ddata[i] + 8388608) * 2.4 / 8388607);
} else {
ddata[i] = ((ddata[i] - 8388608) * 2.4 / 8388607);
}
// Log.i("display", "data: "+ddata[i]);
}
Process(ddata);
}
}
protected void onDestroy()
{
super.onDestroy();
Intent bluetoothserivce = new Intent (this,BluetoothActivity.class);
stopService(bluetoothserivce);
unregisterReceiver(msgReceiver);
super.onDestroy();
}
}
提前致谢。