Iam facing the problem while recieving the data through Bundle..
Intent toAudio = new Intent(TourDescription.this, Audio.class);
toAudio.putExtra("SIZE", arraypoi.size());
for(int i=0; i<arraypoi.size(); i++)
toAudio.putExtra("POI"+i, arraypoi.开发者_开发百科get(i));
startActivity(toAudio);
In the recieving class I have,
Bundle data = getIntent().getExtras();
int size=data.getInt("SIZE");
for(int i=0;i<size;i++)
listOfPOI.add((PointOfIntrest) data.getParcelable("POI"+i));// Iam getting the exception //here..PointOfIntrest is the class name here..
can anyone help me with this ?
Thanks, Keerthiraj
If your for loop is not working then you should make toAudio.putExtra("SIZE",arraypoi.size()); to toAudio.putInt("SIZE", arraypoi.size());. Hope it will work.
精彩评论