[Solved] Passing JSON to new activity – Android app [duplicate]


Thank you all for the answers. This has helped me understand how to use intents and I was able to solve my problem with this:

Activity 1

    String json= textViewResult.getText().toString();
    Intent i = new Intent(Activity1.this, Activity2.class);
    i.putExtra("Data",json);
    startActivity(i);

Activity 2

    Bundle b = getIntent().getExtras();
    String json = b.getString("Data");
    TextView jData = (TextView) findViewById(R.id.textView1);
    jData.setText(json);

solved Passing JSON to new activity – Android app [duplicate]