0

My main class is receiving data from three sub classes. I am using intent to pass data from different activities. However when I received data from one class, data from others classes become blank. I believe it is happening here. A hint please?

Bundle extras = getIntent().getExtras();

    //textview
    textBoxes();

    if (extras != null) {
        String value = extras.getString("email");
        text_mail.setText(value);
    }

    if (extras != null) {
        String val = extras.getString("objet");
        text_objet.setText(val);
    }

    if (extras != null) {
        String valu = extras.getString("message");
        text_message.setText(valu);
    }

I want each class to update only the concerned Id. Is there a way to do this?

Peter O.
  • 32,158
  • 14
  • 82
  • 96
PIONA
  • 79
  • 1
  • 5
  • 12

1 Answers1

0

You cannot do it that way. You need to send all data in one intent.

What you can do is rethink the flow and from you main class call that tree sub classes with startActivityForResult.

Martin Milesich
  • 184
  • 3
  • 8