I’m experiencing problem in Eclipse, when i add a GridView in my layout file
It fills my layout with ITEM 1 ITEM 2 ….. ITEM N
I created an Array Adapter in Activity class and set that array adapter to my grid
String[] listContent = {"A","B","C"};
GridView gridView = (GridView)findViewById(R.id.gridView1);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,listContent);
gridView.setAdapter(adapter);
But my GridView in Eclipse is still showing me ITEM 1 ITEM 2 ….. ITEM N
When i run in AVD, Grid shows me A B C which is the string passed in Array Adapter but my view in Eclipse is not updating, i’m unable to design a porper layout if eclipse will keep showing me the old Grid Items
Does any one know how to update the GridView in Eclipse so that it shows me new items
Is there is any way that i can initialize the GRID VIEW through XML ? So that eclipse will show me the items initialized in XML ?
The graphical layout editor in the Eclipse ADT plugin has no knowledge of the Adapter you will supply the GridView at runtime, therefore it will only display placeholders (Item 1, Item 2…) to help you layout your UI.
You can right click on the GridView in the layout editor, select ‘Preview Grid Content’ and select the layout you want to use for each item, but there isn’t a way to preview it with the data you will bind to it at runtime.