Skip to main content
deleted 6 characters in body
Source Link
bakriOnFire
  • 2.7k
  • 1
  • 17
  • 27

Use the intent.putExtra to pass the data to an another activity.

Intent intent = new Intent(this, NewActivity.class); configIntentintent.putExtra("questionName", array[selectedPosition]); startActivity(configIntentintent); 

then in NewActivity get this string using:-

String questionName = ""; Bundle extras = getIntent().getExtras(); if (extras != null) { this.questionName = extras.getString("questionName"); } 

And set this questionName to setTitle of NewActivity.

Use the intent.putExtra to pass the data to an another activity.

Intent intent = new Intent(this, NewActivity.class); configIntent.putExtra("questionName", array[selectedPosition]); startActivity(configIntent); 

then in NewActivity get this string using:-

String questionName = ""; Bundle extras = getIntent().getExtras(); if (extras != null) { this.questionName = extras.getString("questionName"); } 

And set this questionName to setTitle of NewActivity.

Use the intent.putExtra to pass the data to an another activity.

Intent intent = new Intent(this, NewActivity.class); intent.putExtra("questionName", array[selectedPosition]); startActivity(intent); 

then in NewActivity get this string using:-

String questionName = ""; Bundle extras = getIntent().getExtras(); if (extras != null) { this.questionName = extras.getString("questionName"); } 

And set this questionName to setTitle of NewActivity.

Source Link
bakriOnFire
  • 2.7k
  • 1
  • 17
  • 27

Use the intent.putExtra to pass the data to an another activity.

Intent intent = new Intent(this, NewActivity.class); configIntent.putExtra("questionName", array[selectedPosition]); startActivity(configIntent); 

then in NewActivity get this string using:-

String questionName = ""; Bundle extras = getIntent().getExtras(); if (extras != null) { this.questionName = extras.getString("questionName"); } 

And set this questionName to setTitle of NewActivity.