public void passData(){
Post post=new Post("title","name","25000");
Intent intent = new Intent(this, Test.class);
intent.putExtra("post", post);`
startActivity(intent);
}
            Asked
            
        
        
            Active
            
        
            Viewed 18 times
        
    1 Answers
0
            
            
        try this one it very simple way to pass
public void passData(){
Post post=new Post("title","name","25000");
Intent intent = new Intent(this, Test.class);
intent.putExtra("post", new Gson().toJson(post));
startActivity(intent);
}
in another activity
Intent intent=new Intent()
Post post=Gson().fromJson(intent.getString("post"),Post.class);
   
 
    
    
        Amit pandey
        
- 1,149
- 1
- 4
- 15
 
    