Note that there are some explanatory texts on larger screens.

plurals
  1. PONull pointer error using Expandable list in Fragments
    primarykey
    data
    text
    <p>I'm trying to create an expandable list in one of the tab fragments. I'm getting the null pointer error, but I can't fix it... The problem occurs in this section: expandableListView.setAdapter(adapter); Any help would be appreciated.</p> <p>StackTrace (error):</p> <pre><code> 10-20 12:39:31.603: E/AndroidRuntime(3478): FATAL EXCEPTION: main 10-20 12:39:31.603: E/AndroidRuntime(3478): java.lang.NullPointerException 10-20 12:39:31.603: E/AndroidRuntime(3478): at com.margaret.app.easypeasycooking.CountryAdapter.getGroupCount(CountryAdapter.java:119) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.widget.ExpandableListConnector.getCount(ExpandableListConnector.java:397) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.widget.ListView.setAdapter(ListView.java:463) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.widget.ExpandableListView.setAdapter(ExpandableListView.java:599) 10-20 12:39:31.603: E/AndroidRuntime(3478): at com.margaret.app.easypeasycooking.ShoppingList.onCreateView(ShoppingList.java:37) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.app.Fragment.performCreateView(Fragment.java:1695) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:885) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1057) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.app.BackStackRecord.run(BackStackRecord.java:682) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1435) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.app.FragmentManagerImpl$1.run(FragmentManager.java:441) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.os.Handler.handleCallback(Handler.java:730) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.os.Handler.dispatchMessage(Handler.java:92) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.os.Looper.loop(Looper.java:137) 10-20 12:39:31.603: E/AndroidRuntime(3478): at android.app.ActivityThread.main(ActivityThread.java:5103) 10-20 12:39:31.603: E/AndroidRuntime(3478): at java.lang.reflect.Method.invokeNative(Native Method) 10-20 12:39:31.603: E/AndroidRuntime(3478): at java.lang.reflect.Method.invoke(Method.java:525) 10-20 12:39:31.603: E/AndroidRuntime(3478): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 10-20 12:39:31.603: E/AndroidRuntime(3478): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 10-20 12:39:31.603: E/AndroidRuntime(3478): at dalvik.system.NativeStart.main(Native Method) </code></pre> <p>THe XML:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:id="@+id/shopping"&gt; &lt;ExpandableListView android:id="@+id/elvShoppingList" android:layout_width="wrap_content" android:layout_height="400dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" &gt; &lt;/ExpandableListView&gt; &lt;RadioButton android:id="@+id/radioButton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_marginLeft="18dp" android:text="RadioButton" /&gt; &lt;/RelativeLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload