0

I am new to Android programming and I trying to create a very simple function. I want to display the text (notification message)I entered in activity one to code in activity two activity one:

    @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_one);
    String title = getIntent().getStringExtra("title");
    String message = getIntent().getStringExtra("notification message");
    setTitle(title);
    TextView desc = (TextView) findViewById(R.id.desc1);
    desc.setText(message);
}

I want to display it in activity two:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_two);
    TextView tv1 = (TextView) findViewById(R.id.marqueeTextView2);
    TextView tv2 = (TextView) findViewById(R.id.marqueeTextView);
    ///  I want to display in tv1 and tv2
    tv1.setText("(notification message )");
    tv2.setText("(notification message)");
    tv1.setSelected(true);
    tv2.setSelected(true);
}

0 Answers0