I have stumbled upon an issue I can’t figure out right now. I get an index out of bounds exception when I pass a bundle to a new activity in intent extras.
I use the following code:
Intent intent = new intent(this, statelistactivity.class);
Bundle bundle = new bundle();
Bundle.putInt("id", _id);
Bundle.putString("name", _name);
Intent.putExtras(bundle);
startactivity(intent);
In the receiving activity I use:
String name = getIntent().getString("name);
Following the same principle for the int.
However my code never gets here because of an outofboundsexception. What could cause this?
I found the solution myself. It was completely diferent from what i suspected.
I have a loop running somewhere for a completely different part of the app. But in the program. The error resided there. Deep down the source, it was in fact an arraylist causing it. Thanks for your time and replies.