게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
안드로이드 고수님 오류좀 봐주세요 ㅠ 객체값 전달 오류
게시물ID : programmer_11536짧은주소 복사하기
작성자 : 흔남이개
추천 : 0
조회수 : 5843회
댓글수 : 10개
등록시간 : 2015/06/23 15:45:39
옵션
  • 본인삭제금지
액티비티에서 다른 액티비티로 객체정보를 전달하려는데 오류가 납니다...
 
Intent DisplayActivity = new Intent(MainActivity.this,DisplayActivity.class);
DisplayActivity.putExtra("FTPConnector", ftpc);
startActivity(DisplayActivity);
 
대략 이런식으로 되어있고, 받는쪽에는
 
onCreate부분에 이런식으로 선언이 되있습니다.
FTPConnector ftpc = (FTPConnector)getIntent().getExtras().getSerializable("FTPConnector");
 
FTPConnector 라는 객체는 implements로 Serializable 추가 해줬구요...
 
오류 내용은 이렇습니다.
06-23 15:34:20.240: E/AndroidRuntime(20853): FATAL EXCEPTION: Thread-1805
06-23 15:34:20.240: E/AndroidRuntime(20853): Process: com.example.ftpclient, PID: 20853
06-23 15:34:20.240: E/AndroidRuntime(20853): java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.example.ftpclient.FTPConnector)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.os.Parcel.writeSerializable(Parcel.java:1316)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.os.Parcel.writeValue(Parcel.java:1264)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.os.Parcel.writeArrayMapInternal(Parcel.java:618)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.os.Bundle.writeToParcel(Bundle.java:1692)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.os.Parcel.writeBundle(Parcel.java:636)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.content.Intent.writeToParcel(Intent.java:7710)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2327)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1425)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.app.Activity.startActivityForResult(Activity.java:3623)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.app.Activity.startActivityForResult(Activity.java:3584)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.app.Activity.startActivity(Activity.java:3826)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.app.Activity.startActivity(Activity.java:3794)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at com.example.ftpclient.MainActivity$1$1.run(MainActivity.java:55)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at java.lang.Thread.run(Thread.java:841)
06-23 15:34:20.240: E/AndroidRuntime(20853): Caused by: java.io.NotSerializableException: org.apache.commons.net.ftp.FTPClient
06-23 15:34:20.240: E/AndroidRuntime(20853):  at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1364)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:979)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:368)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1074)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1404)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
06-23 15:34:20.240: E/AndroidRuntime(20853):  at android.os.Parcel.writeSerializable(Parcel.java:1311)
06-23 15:34:20.240: E/AndroidRuntime(20853):  ... 13 more
 
이론상으로는 멀쩡하게 돌아가야 정상인데, 어디서 실수를 한건지.. 아니면 저렇게하면 안된는건지 잘 모르겠네요 ㅠ
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호