I have a listview that shown my sqlite table. I try using Aray Adapter for my first experience and all field shown but its just messy. i want to make them view like a table with three column. i try to implement code from answer at [this link](https://stackoverflow.com/questions/8319219/best-way-to-list-all-in-sqlite-android) here is my code.

```
if (Globals.listoff == null){Globals.listoff = dataSource.getAllproductoff();}
              adapter = new MySimpleAdapter(ViewDataOff.this,dataSource.getAllproductoff() , R.layout.item_list_offeringpro, 
              new String[] { "one", "two","three" },
              new int[] { R.id.edmodul, R.id.edtype,R.id.edtype, R.id.edwinningpro});
              adapter.notifyDataSetChanged();
              setListAdapter(adapter); 

```

Here is my DBDataSource.java

```
 public ArrayList<HashMap<String,Object>> getAllproductoff() {
    ArrayList<HashMap<String, Object>> listoff = new ArrayList<HashMap<String, Object>>();
    Cursor cursor = database.query(DBHelper.TABLE_NAME,
            allColumns, null, null, null, null, null);
    cursor.moveToFirst();
    while (!cursor.isAfterLast()) {
        HashMap<String, Object> map1 = new HashMap<String, Object>();
        map1.put("one", cursor.getLong(cursor.getColumnIndex(DBHelper.COLUMN_ID)));
        map1.put("two", cursor.getString(cursor.getColumnIndex(DBHelper.COLUMN_DESCRIPTION)));
        map1.put("three", cursor.getString(cursor.getColumnIndex(DBHelper.COLUMN_PRICE)));
        listoff.add(map1);
      cursor.moveToNext();
    }
    cursor.close();
    return listoff;
}

```

And Here is MySimpleAdapter.java

```
public class MySimpleAdapter extends SimpleAdapter {
Context localcontext = null;
public MySimpleAdapter(Context context,ArrayList<HashMap<String, Object>> data, int resource, String[] from, int[] to) {
    super(context, data, resource, from, to);
    localcontext = context;
}

public View getView(int position, View convertView, ViewGroup parent) {
    View view = super.getView(position, convertView, parent);
    return view;
}

```

}

Here is my error Log

```
02-21 09:48:21.259: E/AndroidRuntime(21895): FATAL EXCEPTION: main
02-21 09:48:21.259: E/AndroidRuntime(21895): java.lang.ArrayIndexOutOfBoundsException: length=3; index=3
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.SimpleAdapter.bindView(SimpleAdapter.java:160)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.SimpleAdapter.createViewFromResource(SimpleAdapter.java:126)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.SimpleAdapter.getView(SimpleAdapter.java:114)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at ims.app.mobileorder.MySimpleAdapter.getView(MySimpleAdapter.java:22)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.AbsListView.obtainView(AbsListView.java:2271)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.ListView.makeAndAddView(ListView.java:1769)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.ListView.fillDown(ListView.java:672)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.ListView.fillFromTop(ListView.java:733)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.ListView.layoutChildren(ListView.java:1622)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.AbsListView.onLayout(AbsListView.java:2106)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.View.layout(View.java:13932)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.ViewGroup.layout(ViewGroup.java:4498)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1693)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1551)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.LinearLayout.onLayout(LinearLayout.java:1456)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.View.layout(View.java:13932)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.ViewGroup.layout(ViewGroup.java:4498)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.FrameLayout.onLayout(FrameLayout.java:460)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.View.layout(View.java:13932)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.ViewGroup.layout(ViewGroup.java:4498)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1693)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1551)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.LinearLayout.onLayout(LinearLayout.java:1456)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.View.layout(View.java:13932)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.ViewGroup.layout(ViewGroup.java:4498)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.widget.FrameLayout.onLayout(FrameLayout.java:460)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.View.layout(View.java:13932)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.ViewGroup.layout(ViewGroup.java:4498)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1874)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1695)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1002)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4290)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.Choreographer.doCallbacks(Choreographer.java:555)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.Choreographer.doFrame(Choreographer.java:525)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.os.Handler.handleCallback(Handler.java:615)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.os.Handler.dispatchMessage(Handler.java:92)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.os.Looper.loop(Looper.java:137)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at android.app.ActivityThread.main(ActivityThread.java:4803)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at java.lang.reflect.Method.invokeNative(Native Method)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at java.lang.reflect.Method.invoke(Method.java:511)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
02-21 09:48:21.259: E/AndroidRuntime(21895):    at dalvik.system.NativeStart.main(Native Method)

```

thanks for help.. all will be appreciated.