I am trying to use the ActionBarSherlock library to implement a Contextual Action Bar. I have a navigation drawer from which I navigate to another activity containing a listview. While extending my activity from ActionBarActivity, everything works fine, but when I try extending from SherlockListActivity, I get the 'java.lang.NoClassDefFoundError'.
Below is the stack trace:
08-12 17:50:03.563: E/AndroidRuntime(22395): FATAL EXCEPTION: main 08-12 17:50:03.563: E/AndroidRuntime(22395): java.lang.NoClassDefFoundError: com.example.scholar.Assignments 08-12 17:50:03.563: E/AndroidRuntime(22395): at com.example.scholar.Schedule.selectItem(Schedule.java:171) 08-12 17:50:03.563: E/AndroidRuntime(22395): at com.example.scholar.Schedule.access$0(Schedule.java:162) 08-12 17:50:03.563: E/AndroidRuntime(22395): at com.example.scholar.Schedule$DrawerListItemClickListener.onItemClick(Schedule.java:158) 08-12 17:50:03.563: E/AndroidRuntime(22395): at android.widget.AdapterView.performItemClick(AdapterView.java:298) 08-12 17:50:03.563: E/AndroidRuntime(22395): at android.widget.AbsListView.performItemClick(AbsListView.java:1114) 08-12 17:50:03.563: E/AndroidRuntime(22395): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2933) 08-12 17:50:03.563: E/AndroidRuntime(22395): at android.widget.AbsListView$1.run(AbsListView.java:3691) 08-12 17:50:03.563: E/AndroidRuntime(22395): at android.os.Handler.handleCallback(Handler.java:615) 08-12 17:50:03.563: E/AndroidRuntime(22395): at android.os.Handler.dispatchMessage(Handler.java:92) 08-12 17:50:03.563: E/AndroidRuntime(22395): at android.os.Looper.loop(Looper.java:153) 08-12 17:50:03.563: E/AndroidRuntime(22395): at android.app.ActivityThread.main(ActivityThread.java:5086) 08-12 17:50:03.563: E/AndroidRuntime(22395): at java.lang.reflect.Method.invokeNative(Native Method) 08-12 17:50:03.563: E/AndroidRuntime(22395): at java.lang.reflect.Method.invoke(Method.java:511) 08-12 17:50:03.563: E/AndroidRuntime(22395): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821) 08-12 17:50:03.563: E/AndroidRuntime(22395): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584) 08-12 17:50:03.563: E/AndroidRuntime(22395): at dalvik.system.NativeStart.main(Native Method)
Whereas the method for navigating to the activity with the listview is:
private class DrawerListItemClickListener implements ListView.OnItemClickListener { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { selectItem(position); } }
private void selectItem(int position) {
// just trying things out and they appear to be working
switch (position) {
case 0:
Intent i = new Intent(Schedule.this, Timetable.class);
startActivity(i);
break;
case 1:
Intent assignment = new Intent(Schedule.this, Assignments.class);
startActivity(assignment);
break;
case 2:
}
/**
* Update selected item and title, then close drawer
*/
mDrawerList.setItemChecked(position, true);
setTitle(mDrawerListTitles[position]);
mDrawerLayout.closeDrawer(mDrawerList);
}
Assistance will be highly appreciated