How to pass an object from one activity to another on Android

后端 未结 30 3951
遇见更好的自我
遇见更好的自我 2020-11-21 04:03

I am trying to work on sending an object of my customer class from one Activity and display it in another Activity.

The code for t

30条回答
  •  温柔的废话
    2020-11-21 05:05

    Pass one activity to another:

    startActivity(new Intent(getBaseContext(),GetActivity.class).putExtra("passingkey","passingvalue"));
    

    Get values:

    String myvalue= getIntent().getExtras("passingkey");
    

提交回复
热议问题