I need to pass an object from one activity to another activity , I am using tesserect OCr Library so I need to pass its object,Please tell me how i do this i am struck here. Advance Thanks.
Asked
Active
Viewed 221 times
0
-
1You can go with a solution either from `Parcelable` or `Serilizable`. – Paresh Mayani Mar 05 '12 at 05:29
-
Look here...http://stackoverflow.com/questions/7846162/best-way-to-pass-objects-from-one-activity-to-another – Shashank Kadne Mar 05 '12 at 05:29
2 Answers
0
For either parcelable/serializable, you are required to know its internal structure. If you don't know it or cannot guess it, then I suggest you make it a global object and access it from whichever activity you require.

Shubhayu
- 13,402
- 5
- 33
- 30
0
You can go with a solution either from Parcelable or Serializable
Using Serializablee its pretty easy :-
just make your custom class as Serializable ( by extend Serializable class )
intent.putExtra("myobject", new Persion("name1",915698452387));
get from target activity :-
Person p1 = (Person) getIntent().getSerializableExtra("myobject");
try this..

Community
- 1
- 1

Hari Raghuwanshi
- 33
- 4