In my android activity B
, I read values bundled in the intent like this
Bundle bundle = getIntent().getExtras();
Boolean mine = bundle.getString("mine").equals("1");
int pagenum = bundle.getInt("page");
When I start B
from another activity A
, I give in mine=0,pagenum=0.
And I can read that fine in B
.
But then in B
, I want to reload the activity, by finishing itself and opening another B
. I also need to pass in the new data like this:
private void refresh(Boolean mine, int newpage) {
finish();
Intent myIntent = new Intent(this, AllThreadsScreen.class);
myIntent.putExtra("mine", mine ? "1" : "0");
myIntent.putExtra("page", Integer.toString(newpage, 10));
startActivity(myIntent);
}
When I call this, I make sure that newpage
has a value of 1
. However the problem is that, after starting the activity, when I read the page
value from the bundle, it becomes 0 again...
Does anyone know whats wrong?
Thanks.