내가 다음 코드 활동에 BluetoothSocket을 전달하기 위해 노력하고있어 마샬링 할 수 없습니다 :
소포 : 값 android.bluetooth.BluetoothSocket에게
Intent intent = new Intent(getActivity(), ChatActivity.class);
Bundle bundle = new Bundle();
ArrayList array = new ArrayList<BluetoothSocket>();
array.add(connectToDevice.getMmSocket());
bundle.putParcelableArrayList("Array", array);
startActivity(intent, bundle);
그러나이 나는 활동에서 그것을 얻을하려고 할 때 나는 다음과 같은 코드로 시작하려는 :
java.lang.RuntimeException: Parcel: unable to marshal value [email protected]`
:
Bundle bundle = getIntent().getExtras();
Parcelable[] parceble = bundle.getParcelableArray("Array");
ArrayList<BluetoothSocket> array = new ArrayList<>(parceble.length);
BluetoothSocket socket = array.get(0);
나는이 오류
제발 도와주세요. 미리 감사드립니다.
이 클래스를 Intent를 통해 전달할 수 없습니다. 봉사 활동을하고 활동 속으로 묶으십시오. – Selvin
@Selvin \t 어떻게해야합니까? 미리 양해 해 주셔서 감사합니다 –