title: android.content.res.Resources$NotFoundException: Resource ID #0x0 java exception
body: <p>This exception occurs while running a fragment trying to display a ListView of objects. I have researched the exception but the solution for other cases seems to have to do with the "setText" function, or anything else trying to display anything else than a string as a string. I'm really not sure what else to say. Thanks in advance!</p>
  
  <p>Java Class</p>
  
  <pre><code>import android.content.Context;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.LinearLayout;
  import android.widget.ListView;
  import android.widget.Spinner;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import java.util.ArrayList;
  
  import in.galaxyofandroid.spinerdialog.OnSpinerItemClick;
  import in.galaxyofandroid.spinerdialog.SpinnerDialog;
  
  import static android.R.attr.name;
  import static android.R.attr.value;
  import static com.company.ingredismartv2.R.id.add;
  import static com.company.ingredismartv2.R.id.fragment;
  import static com.company.ingredismartv2.R.id.nav_kitchen;
  
  public class Kitchen extends Fragment {
  
  public Kitchen() {
      // Required empty public constructor
  }
  
  SpinnerDialog spinnerDialog;
  Button add;
  ArrayList&lt;String&gt; listOfIngs = new ArrayList&lt;&gt;();
  
  
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
  
      View root = inflater.inflate(R.layout.fragment_kitchen, container, false);
      add = (Button) root.findViewById(R.id.add);
      add.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              spinnerDialog.showSpinerDialog();
          }
      });
  
      IngAdapter adapter = new IngAdapter(getContext(), listOfIngs);
      ListView listView = (ListView) root.findViewById(R.id.list);
      listView.setAdapter(adapter);
      return root;
  
  }
  
  public class IngAdapter extends ArrayAdapter&lt;String&gt; {
      IngAdapter(Context context, ArrayList&lt;String&gt; ings) {
          super(context, 0, ings);
      }
  
  
  }
  
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      spinnerDialog = new SpinnerDialog(getActivity(), ingredients, "Select An Ingredient");
  
      final Ing tomatoSauce = new Ing("Tomato Sauce", 0 ,0);
      listOfIngs.add(tomatoSauce.name);
      final Ing chicken = new Ing("Chicken", 0 ,0);
      listOfIngs.add(chicken.name);
      final Ing olives = new Ing("Olives", 0, 0);
      listOfIngs.add(olives.name);
  
      ingredients.add("Tomato Sauce");
      ingredients.add("Chicken");
      ingredients.add("Olives");
  
      ArrayList&lt;Ing&gt; ing = new ArrayList&lt;&gt;();
  
  
  
      spinnerDialog.bindOnSpinerListener(new OnSpinerItemClick() {
  
          @Override
          public void onClick(String Ingredient, int i) {
  
              Toast.makeText(Kitchen.super.getContext(), "Selected "+Ingredient, Toast.LENGTH_SHORT).show();
  
              if(Ingredient.equals(tomatoSauce.name)) {
  
                  if (tomatoSauce.init == 0){
  
                      tomatoSauce.init = 1;
  
                  }
  
              } else if(Ingredient.equals(chicken.name)) {
  
                  if (chicken.init == 0){
  
                      chicken.init = 1;
  
                  }
  
              } else if(Ingredient.equals(olives.name)){
  
                  if (olives.init == 0){
  
                      olives.init = 1;
  
                  }
  
              }
  
          }
      });
  
  
  }
  
  ArrayList&lt;String&gt; ingredients = new ArrayList&lt;&gt;();
  
  
  
  public class Ing {
  
      int init;
  
      int value;
  
      String name;
  
      Ing(String name, int value, int init) {
          this.name = name;
          this.value = value;
          this.init = init;
      }
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>XML Layout</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="com.company.ingredismartv2.Kitchen"&gt;
  
  &lt;!-- TODO: Update blank fragment layout --&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
      &lt;Button
          android:text="Add An Ingredient"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/add"
          android:textSize="30sp"
          android:layout_gravity="center" /&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="horizontal"&gt;
  
  
          &lt;ListView
              android:layout_width="320dp"
              android:layout_height="match_parent"
              android:id="@+id/list"&gt;
  
          &lt;/ListView&gt;
  
          &lt;ListView
              android:layout_width="60dp"
              android:layout_height="match_parent"&gt;
  
          &lt;/ListView&gt;
  
      &lt;/LinearLayout&gt;
  
  
  
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>Edit (logs)</p>
  
  <pre><code>I/Adreno-EGL: &lt;qeglDrvAPI_eglInitialize:379&gt;: EGL 1.4 QUALCOMM build:  ()
            OpenGL ES Shader Compiler Version: E031.25.03.04
            Build Date: 04/06/15 Mon
            Local Branch: 
            Remote Branch: 
            Local Patches: 
            Reconstruct Branch: 
  I/OpenGLRenderer: Initialized EGL, version 1.4
  D/OpenGLRenderer: Enabling debug mode 0
  `enter code here`W/ResourceType: No package identifier when getting value for resource number 0x00000000
  D/AndroidRuntime: Shutting down VM
  E/AndroidRuntime: FATAL EXCEPTION: main
                Process: com.comapany.ingredismartv2, PID: 9504
                android.content.res.Resources$NotFoundException: Resource ID #0x0
                    at android.content.res.Resources.getValue(Resources.java:1266)
                    at android.content.res.Resources.loadXmlResourceParser(Resources.java:2652)
                    at android.content.res.Resources.getLayout(Resources.java:1082)
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:412)
                    at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:371)
                    at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
                    at android.widget.AbsListView.obtainView(AbsListView.java:2347)
                    at android.widget.ListView.makeAndAddView(ListView.java:1864)
                    at android.widget.ListView.fillDown(ListView.java:698)
                    at android.widget.ListView.fillFromTop(ListView.java:759)
                    at android.widget.ListView.layoutChildren(ListView.java:1673)
                    at android.widget.AbsListView.onLayout(AbsListView.java:2151)
                    at android.view.View.layout(View.java:15689)
                    at android.view.ViewGroup.layout(ViewGroup.java:5040)
                    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
                    at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1692)
                    at android.widget.LinearLayout.onLayout(LinearLayout.java:1468)
                    at android.view.View.layout(View.java:15689)
                    at android.view.ViewGroup.layout(ViewGroup.java:5040)
                    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
                    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
                    at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
                    at android.view.View.layout(View.java:15689)
                    at android.view.ViewGroup.layout(ViewGroup.java:5040)
                    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
                    at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
                    at android.view.View.layout(View.java:15689)
                    at android.view.ViewGroup.layout(ViewGroup.java:5040)
                    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
                    at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
                    at android.view.View.layout(View.java:15689)
                    at android.view.ViewGroup.layout(ViewGroup.java:5040)
                    at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1076)
                    at android.view.View.layout(View.java:15689)
                    at android.view.ViewGroup.layout(ViewGroup.java:5040)
                    at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:131)
                    at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
                    at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1391)
                    at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:870)
                    at android.view.View.layout(View.java:15689)
                    at android.view.ViewGroup.layout(ViewGroup.java:5040)
                    at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1193)
                    at android.view.View.layout(View.java:15689)
                    at android.view.ViewGroup.layout(ViewGroup.java:5040)
                    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
                    at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
                    at android.view.View.layout(View.java:15689)
                    at android.view.ViewGroup.layout(ViewGroup.java:5040)
                    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
                    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
                    at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
                    at android.view.View.layout(View.java:15689)
                    at android.view.ViewGroup.layout(ViewGroup.java:5040)
                    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
                    at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
                    at android.view.View.layout(View.java:15689)
                    at android.view.ViewGroup.layout(ViewGroup.java:5040)
                    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
                    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
                    at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
                    at android.view.View.layout(View.java:15689)
                    at android.view.ViewGroup.layout(ViewGroup.java:5040)
                  at android.widget.FrameLay
  I/Process: Sending signal. PID: 9504 SIG: 9
  Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'
  </code></pre>