The value in string.xml file…
<string name="bangla_history_2ndpoint">SOME VALUE </string>
From this activity i am trying to pass value to another activity … by using putextra
Intent ptwo=new Intent("com.powergroupbd.victoryday.of.bangladesh.HISTORYDESCRIPTION");
ptwo.putExtra("header", R.string.bangla_history_2ndpoint);
startActivity(ptwo);
Then get the value in this activity …
But it is not getting the value from the string.xml file…
text_point = getIntent().getStringExtra("header");
Toast.makeText(getApplicationContext(), text_point, Toast.LENGTH_LONG).show();
But it is toasting blank ….
Please give a solution…
That’s because you’re trying to retrieve a
String, but what you’re passing in as extra is actually the resource identifier of it, anint. Either put an actual string as extra, or retrieve an int on the receiving end to fix this.Or: