0

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.

Carlos Gavidia-Calderon
  • 7,145
  • 9
  • 34
  • 59
AsadYarKhan
  • 678
  • 2
  • 14
  • 31

2 Answers2

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