다른 활동에 응답 개체 (soapobject)를 보내려고합니다.활동간에 개체 인스턴스를 전달하는 방법
참고 : 개체를 만들지 않고 웹 서비스의 응답으로 수신합니다.
제 활성 내 로직은 응답이 하나 개 이상의 결과를 포함하는 경우, 다음
MY 문제 (그렇지 않으면 "no results
"메시지를 표시) 추가 처리를 위해 다음 활동에 보내이다을 putExtra
은 non serilaized
또는 non parcelable object
을 전송할 수 없습니다.
오류 메시지 : 여기 The method putExtra(String, boolean) in the type Intent is not applicable for the arguments (String, SoapObject)
내 코드가 어떤 제안입니까?
SoapObject soapResponse = soaphttp.fetchNextCatalogueRange(0, numberOfItems);
Intent ResultsActivityIntent = new Intent(MainActivity.this,SearchResultsActivity.class);
// Send data object with the Intent
ResultsActivityIntent.putExtra("ResultObj", soapResponse);
startActivity(ResultsActivityIntent);
http://stackoverflow.com/questions/2736389/how-to-pass-object-from-one-activity-to-another-in-android – user2450263
'Parcelable'을 구현해야합니다. 이 답변을 확인하십시오 [어떻게 활동간에 개체를 전달할] (http://stackoverflow.com/questions/2736389/how-to-pass-object-from-one-activity-to-another-in-android) – Apoorv
캔트 사용 나는 객체를 생성하지 않기 때문에 필자는 그것을 캐스팅 할 수없는 검색 결과로 받는다. – user1882582