Using GreenDroid ItemAdapter with regular Activity
I want to use GreenDroid's ItemAdapter and custom list items with a regular ListActivity (or in Future in SherlockListActivity). I extracted ItemAdapter, Item and View classes and created a custom project. (Note: Yesterday I tried the same thing using whole GreenDroid project. So, there is no problem with my new extracted project)

My example ListActivity:

    public class TestActivity extends ListActivity {
        /** Called when the activity is first created. */
    	
    	ItemAdapter adapter;
    	
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            
            adapter=new ItemAdapter(this);
            adapter.add(new TextItem("test"));
            adapter.notifyDataSetChanged();
            setListAdapter(adapter);
        }
    }

crashes and gives this output:

> 01-30 17:07:33.983: E/AndroidRuntime(21042): FATAL EXCEPTION: main
> 01-30 17:07:33.983: E/AndroidRuntime(21042):
> android.view.InflateException: Binary XML file line #20: Error
> inflating class com.itusozluk.itemadapter.widget.itemview.TextItemView
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.LayoutInflater.createView(LayoutInflater.java:606) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.LayoutInflater.inflate(LayoutInflater.java:466) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.LayoutInflater.inflate(LayoutInflater.java:396) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> com.itusozluk.itemadapter.widget.item.Item.createCellFromXml(Item.java:125)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> com.itusozluk.itemadapter.widget.item.TextItem.newView(TextItem.java:61)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> com.itusozluk.itemadapter.ItemAdapter.getView(ItemAdapter.java:445)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.AbsListView.obtainView(AbsListView.java:2033) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.ListView.makeAndAddView(ListView.java:1772) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.ListView.fillDown(ListView.java:672) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.ListView.fillFromTop(ListView.java:732) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.ListView.layoutChildren(ListView.java:1625) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.AbsListView.onLayout(AbsListView.java:1863) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.View.layout(View.java:11278) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.view.ViewGroup.layout(ViewGroup.java:4224) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.widget.FrameLayout.onLayout(FrameLayout.java:431) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.View.layout(View.java:11278) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.view.ViewGroup.layout(ViewGroup.java:4224) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.LinearLayout.onLayout(LinearLayout.java:1399) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.View.layout(View.java:11278) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.view.ViewGroup.layout(ViewGroup.java:4224) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.widget.FrameLayout.onLayout(FrameLayout.java:431) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.View.layout(View.java:11278) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.view.ViewGroup.layout(ViewGroup.java:4224) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1489)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.os.Handler.dispatchMessage(Handler.java:99) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.os.Looper.loop(Looper.java:137) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.app.ActivityThread.main(ActivityThread.java:4424) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> java.lang.reflect.Method.invokeNative(Native Method) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> java.lang.reflect.Method.invoke(Method.java:511) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> dalvik.system.NativeStart.main(Native Method) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): Caused by:
> java.lang.reflect.InvocationTargetException 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> java.lang.reflect.Constructor.constructNative(Native Method) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> java.lang.reflect.Constructor.newInstance(Constructor.java:417) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.LayoutInflater.createView(LayoutInflater.java:586) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	... 35 more 01-30
> 17:07:33.983: E/AndroidRuntime(21042): Caused by:
> java.lang.UnsupportedOperationException: Can't convert to dimension:
> type=0x2 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.View.<init>(View.java:2791) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.widget.TextView.<init>(TextView.java:449) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> com.itusozluk.itemadapter.widget.itemview.TextItemView.<init>(TextItemView.java:36)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> com.itusozluk.itemadapter.widget.itemview.TextItemView.<init>(TextItemView.java:32)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	... 38 more

I think the most important part is:

> java.lang.UnsupportedOperationException: Can't convert to dimension:
> type=0x2 01-30 17:07:33.983: E/AndroidRuntime(21042):

There should be something in GreenDroid's dimension files.

How to fix? How can be used GreenDroid's ItemAdapter without GDActivity?
Using GreenDroid ItemAdapter with regular Activity
===

I want to use GreenDroid's ItemAdapter and custom list items with a regular ListActivity (or in Future in SherlockListActivity). I extracted ItemAdapter, Item and View classes and created a custom project. (Note: Yesterday I tried the same thing using whole GreenDroid project. So, there is no problem with my new extracted project)

My example ListActivity:

    public class TestActivity extends ListActivity {
        /** Called when the activity is first created. */
    	
    	ItemAdapter adapter;
    	
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            
            adapter=new ItemAdapter(this);
            adapter.add(new TextItem("test"));
            adapter.notifyDataSetChanged();
            setListAdapter(adapter);
        }
    }

crashes and gives this output:

> 01-30 17:07:33.983: E/AndroidRuntime(21042): FATAL EXCEPTION: main
> 01-30 17:07:33.983: E/AndroidRuntime(21042):
> android.view.InflateException: Binary XML file line #20: Error
> inflating class com.itusozluk.itemadapter.widget.itemview.TextItemView
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.LayoutInflater.createView(LayoutInflater.java:606) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.LayoutInflater.inflate(LayoutInflater.java:466) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.LayoutInflater.inflate(LayoutInflater.java:396) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> com.itusozluk.itemadapter.widget.item.Item.createCellFromXml(Item.java:125)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> com.itusozluk.itemadapter.widget.item.TextItem.newView(TextItem.java:61)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> com.itusozluk.itemadapter.ItemAdapter.getView(ItemAdapter.java:445)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.AbsListView.obtainView(AbsListView.java:2033) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.ListView.makeAndAddView(ListView.java:1772) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.ListView.fillDown(ListView.java:672) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.ListView.fillFromTop(ListView.java:732) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.ListView.layoutChildren(ListView.java:1625) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.AbsListView.onLayout(AbsListView.java:1863) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.View.layout(View.java:11278) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.view.ViewGroup.layout(ViewGroup.java:4224) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.widget.FrameLayout.onLayout(FrameLayout.java:431) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.View.layout(View.java:11278) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.view.ViewGroup.layout(ViewGroup.java:4224) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.widget.LinearLayout.onLayout(LinearLayout.java:1399) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.View.layout(View.java:11278) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.view.ViewGroup.layout(ViewGroup.java:4224) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.widget.FrameLayout.onLayout(FrameLayout.java:431) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.View.layout(View.java:11278) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.view.ViewGroup.layout(ViewGroup.java:4224) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1489)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.os.Handler.dispatchMessage(Handler.java:99) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.os.Looper.loop(Looper.java:137) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.app.ActivityThread.main(ActivityThread.java:4424) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> java.lang.reflect.Method.invokeNative(Native Method) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> java.lang.reflect.Method.invoke(Method.java:511) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> dalvik.system.NativeStart.main(Native Method) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): Caused by:
> java.lang.reflect.InvocationTargetException 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> java.lang.reflect.Constructor.constructNative(Native Method) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> java.lang.reflect.Constructor.newInstance(Constructor.java:417) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.LayoutInflater.createView(LayoutInflater.java:586) 01-30
> 17:07:33.983: E/AndroidRuntime(21042): 	... 35 more 01-30
> 17:07:33.983: E/AndroidRuntime(21042): Caused by:
> java.lang.UnsupportedOperationException: Can't convert to dimension:
> type=0x2 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> android.view.View.<init>(View.java:2791) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> android.widget.TextView.<init>(TextView.java:449) 01-30 17:07:33.983:
> E/AndroidRuntime(21042): 	at
> com.itusozluk.itemadapter.widget.itemview.TextItemView.<init>(TextItemView.java:36)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	at
> com.itusozluk.itemadapter.widget.itemview.TextItemView.<init>(TextItemView.java:32)
> 01-30 17:07:33.983: E/AndroidRuntime(21042): 	... 38 more

I think the most important part is:

> java.lang.UnsupportedOperationException: Can't convert to dimension:
> type=0x2 01-30 17:07:33.983: E/AndroidRuntime(21042):

There should be something in GreenDroid's dimension files.

How to fix? How can be used GreenDroid's ItemAdapter without GDActivity?