Hi I am trying to pass my ArrayList
value into my TabLayout
but I am getting null value please help me...I successfully passed my string value but ArrayList
value only null...
here I am trying to pass my string and ArrayList
value..........
this is my code:
sdcardImages.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView parent, View v, int position, long id) {
Intent intent = new Intent(ParxmlActivity.this, tabview.class);
intent.putExtra("spec",model_List.get(position).spec);
intent.putExtra("mimage",model_List.get(position).mimage);
intent.putStringArrayListExtra("imageList", model_List.get(position).imageList);
startActivity(intent);
}
});
the 1st and 2nd value working fine....spec and mimage but imageList only i am getting null value......
public class tabview extends TabActivity {
Bundle tab_intent;
public static String spec, mimage, imageList;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.viewtab);
tab_intent=tabview.this.getIntent().getExtras();
spec=tab_intent.getString("spec");
mimage = tab_intent.getString("mimage");
imageList = tab_intent.getString("imageList");
above code I am try to get my values the ImageList
value only shows null
what is the reason?
code:
package ml.ml;
import java.util.ArrayList;
import android.os.Parcel;
import android.os.Parcelable;
public class schild {
public String name;
public String model;
public String spec;
public String mimage;
//public String imageList;
//public String videoList;
public ArrayList<String> imageList;
public ArrayList<String> videoList;
public schild(){
name = new String();
model = new String();
spec = new String();
mimage = new String();
imageList = new ArrayList<String>();
videoList = new ArrayList<String>();
//imageList =new String();
//videoList = new String();
}
}
here I am adding to separate ArrayList
for(int j = 0; j<model_List.size(); j++){
mname_List.add(model_List.get(j).name);
mmimage.add(model_List.get(j).mimage);
mspec_List.add(model_List.get(j).spec);
mvideo_List.addAll(model_List.get(j).videoList);
mmimage_List.addAll(model_List.get(j).imageList);
}
this is value I am trying to passing in tab host.......