Intent.getInt() doesn't work on ICS, but works on JB
- by ObAt
I use this code to send parameters when I start a new Activity:
Intent inputForm = new Intent(getActivity(), InputForm.class);
Bundle b = new Bundle();
b.putInt("item", Integer.parseInt(mItem.id)); //Your id
inputForm.putExtras(b); //Put your id to your next Intent
startActivity(inputForm);
And I use this code for reading the parameters in the inputForm Activity:
Bundle b = getIntent().getExtras();
if (b != null) {
int value = b.getInt("item");
ID = value;
}
Toast.makeText(getApplication(), "MIJN ID:" + Integer.toString(ID), Toast.LENGTH_LONG).show();
When I run this code on my Samsung Tab 10.1 GT-P7510 ID is alsways 0, when I run the same code on my Galaxy S3 with JB the code just works fine. Can someone help me?
Thanks in advance,
ObAt