title: App crashing from listview implementaion
body: <p>I recently tried to create a custom row for listview.  I tried to do it off a tutorial but it crashes when I tried to change it so the rows work with what I want my app to display.  Error readout is at the bottom.  </p>
  
  <p>Also not related to the problem but I was curious if I am able to use imageId as my holder in the custom adapter class for each of the 3 images I want to be in the row or if they need to be unique.<br>
      holder.img2.setImageResource(imageId[position]);</p>
  
  <p>-----Homeactivitylistview.java-----------</p>
  
  <pre><code>public class HomeActivityListview extends AppCompatActivity {
  
      ListView lv;
      Context context;
      ArrayList dogName;
      ArrayList dogID;
      public static int [] dogImages={R.id.dogimage};
      public static String [] dogNames={};
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_home_activity_listview);
  
          context=this;
  
          lv=(ListView) findViewById(R.id.listView);
          lv.setAdapter(new CustomAdapter(this, dogImages));
      }
  
  
      public void sendProfile(View view) {
          Intent intent = new Intent(getApplicationContext(),  DogProfileActivity.class);
          startActivity(intent);
  
      }
  
      public void NumberOne(View view) {
          AlertDialog.Builder alertDlg = new AlertDialog.Builder(this);
          alertDlg.setMessage("Confirm Dog went number one");
          alertDlg.setCancelable(false);
  
          alertDlg.setPositiveButton("Confirm", new     DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                  //HomeActivity.super.onBackPressed();
              }
          });
  
          alertDlg.setNegativeButton("Change", new     DialogInterface.OnClickListener(){
  
              @Override
              public void onClick(DialogInterface dialog, int which) {
                  //HomeActivity.super.onBackPressed();
              }
          });
          alertDlg.create().show();
  
      }
      public void NumberTwo(View view) {
          AlertDialog.Builder alertDlg = new AlertDialog.Builder(this);
          alertDlg.setMessage("Confirm Dog went number two");
          alertDlg.setCancelable(false);
  
          alertDlg.setPositiveButton("Confirm", new     DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                  //HomeActivity.super.onBackPressed();
              }
          });
  
          alertDlg.setNegativeButton("Change", new     DialogInterface.OnClickListener(){
  
              @Override
              public void onClick(DialogInterface dialog, int which) {
                  //HomeActivity.super.onBackPressed();
              }
          });
          alertDlg.create().show();
  
      }
  
      public void AddNewDog(View view) {
          Intent intent = new Intent(getApplicationContext(),     NewDogActivity.class);
          startActivity(intent);
      }
  
  }
  </code></pre>
  
  <p>------------------- customadapter.java -------------------------</p>
  
  <pre><code>public class CustomAdapter extends BaseAdapter{
  String [] result;
  Context context;
  int [] imageId;
  private static LayoutInflater inflater=null;
  public CustomAdapter(HomeActivityListview homeActivityListview, int[]     dogImages) {
      // TODO Auto-generated constructor stub
      context=homeActivityListview;
      imageId=dogImages;
      inflater = ( LayoutInflater )context.
              getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  }
  @Override
  public int getCount() {
      // TODO Auto-generated method stub
      return imageId.length;
  }
  
  @Override
  public Object getItem(int position) {
      // TODO Auto-generated method stub
      return position;
  }
  
  @Override
  public long getItemId(int position) {
      // TODO Auto-generated method stub
      return position;
  }
  
  public class Holder
  {
  
      ImageView img;
      ImageView img1;
      ImageView img2;
  }
  @Override
  public View getView(final int position, View convertView, ViewGroup parent)             {
      // TODO Auto-generated method stub
      Holder holder=new Holder();
      View rowView;
      rowView = inflater.inflate(R.layout.home_single_row, null);
      holder.img=(ImageView) rowView.findViewById(R.id.dogimage);
      holder.img1=(ImageView) rowView.findViewById(R.id.dog1num1);
      holder.img2=(ImageView) rowView.findViewById(R.id.dog1num2);
      holder.img.setImageResource(imageId[position]);
      holder.img1.setImageResource(imageId[position]);
      holder.img2.setImageResource(imageId[position]);
      rowView.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
              Toast.makeText(context, "You Clicked "+result[position],     Toast.LENGTH_LONG).show();
          }
      });
      return rowView;
  }
  
  }
  </code></pre>
  
  <p>----------------------singlerow.xml--------------------------</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="horizontal"
  android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  
  &lt;ImageButton
      android:layout_width="150dip"
      android:layout_height="150dip"
      android:id="@+id/dogimage"
      android:clickable="true"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:background="@drawable/dogpic"
      android:onClick="sendProfile"/&gt;
  
  &lt;ImageButton
      android:layout_width="75dip"
      android:layout_height="75dip"
      android:id="@+id/dog1num1"
      android:background="@drawable/num1"
      android:clickable="true"
      android:onClick="NumberOne"
      android:layout_marginLeft="30dp"
      android:layout_marginTop="75dp" /&gt;
  
  &lt;ImageButton
      android:layout_width="75dip"
      android:layout_height="75dip"
      android:id="@+id/dog1num2"
      android:background="@drawable/num2"
      android:clickable="true"
      android:onClick="NumberTwo"
      android:layout_marginLeft="25dp"
      android:layout_marginTop="75dp" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>------------homescreen.xml------------------</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout 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"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context="cs495capstone.edu.bsu.doggydid.HomeActivityListview
  "
  android:background="@drawable/screenbackground"&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/selectprofiletext"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:textColor="#2c7134"
      android:text="Select a profile or make a post:"
      /&gt;
  
  &lt;ListView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/listView"
      android:layout_above="@+id/newdogbutton"
      android:entries="@array/dogs"
      android:layout_below="@+id/selectprofiletext"
      android:layout_marginTop="10dip" /&gt;
  
  &lt;Button
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="Add new dog"
      android:id="@+id/newdogbutton"
      android:background="#2c7134"
      android:allowUndo="true"
      android:textColor="#f3ca83"
      android:clickable="true"
      android:layout_alignParentBottom="true"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:onClick="AddNewDog"
      /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>------------------ Error readout ------------------------</p>
  
  <blockquote>
    <p>04-07 14:06:40.998 2532-2532/cs495capstone.edu.bsu.doggydid
    E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                  Process: cs495capstone.edu.bsu.doggydid, PID: 2532
                                                                                  android.content.res.Resources$NotFoundException: Resource
    "cs495capstone.edu.bsu.doggydid:id/dogimage" (7f0d008e)  is not a
    Drawable (color or path): TypedValue{t=0x12/d=0x0 a=2 r=0x7f0d008e}
                                                                                      at
    android.content.res.Resources.loadDrawableForCookie(Resources.java:2390)
                                                                                      at android.content.res.Resources.loadDrawable(Resources.java:2330)
                                                                                      at android.content.res.Resources.getDrawable(Resources.java:758)
                                                                                      at android.content.Context.getDrawable(Context.java:402)
                                                                                      at
    android.support.v4.content.ContextCompatApi21.getDrawable(ContextCompatApi21.java:26)
                                                                                      at
    android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:321)
                                                                                      at
    android.support.v7.widget.TintManager.getDrawable(TintManager.java:175)
                                                                                      at
    android.support.v7.widget.TintManager.getDrawable(TintManager.java:168)
                                                                                      at
    android.support.v7.widget.AppCompatImageHelper.setImageResource(AppCompatImageHelper.java:51)
                                                                                      at
    android.support.v7.widget.AppCompatImageButton.setImageResource(AppCompatImageButton.java:73)
                                                                                      at
    cs495capstone.edu.bsu.doggydid.CustomAdapter.getView(CustomAdapter.java:57)
                                                                                      at android.widget.AbsListView.obtainView(AbsListView.java:2344)
                                                                                      at android.widget.ListView.measureHeightOfChildren(ListView.java:1270)
                                                                                      at android.widget.ListView.onMeasure(ListView.java:1182)
                                                                                      at android.view.View.measure(View.java:17430)
                                                                                      at
    android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:727)
                                                                                      at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:463)
                                                                                      at android.view.View.measure(View.java:17430)
                                                                                      at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
                                                                                      at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
                                                                                      at
    android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)
                                                                                      at android.view.View.measure(View.java:17430)
                                                                                      at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
                                                                                      at
    android.support.v7.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:391)
                                                                                      at android.view.View.measure(View.java:17430)
                                                                                      at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
                                                                                      at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
                                                                                      at android.view.View.measure(View.java:17430)
                                                                                      at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
                                                                                      at
    android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
                                                                                      at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
                                                                                      at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
                                                                                      at android.view.View.measure(View.java:17430)
                                                                                      at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
                                                                                      at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
                                                                                      at
    com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2560)
                                                                                      at android.view.View.measure(View.java:17430)
                                                                                      at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2001)
                                                                                      at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1166)
                                                                                      at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1372)
                                                                                      at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1054)
                                                                                      at
    android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5779)
                                                                                      at
    android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
                                                                                      at android.view.Choreographer.doCallbacks(Choreographer.java:580)
                                                                                      at android.view.Choreographer.doFrame(Choreographer.java:550)
                                                                                      at
    android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
                                                                                      at android.os.Handler.handleCallback(Handler.java:739)
                                                                                      at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                      at android.os.Looper.loop(Looper.java:135)
                                                                                      at android.app.ActivityThread.main(ActivityThread.java:5221)
                                                                                      at java.lang.reflect.Method.invoke(Native Method)
                                                                                      at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                      at
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
                                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) 04-07
    14:07:23.942 2532-2532/cs495capstone.edu.bsu.doggydid I/Process:
    Sending signal. PID: 2532 SIG: 9</p>
  </blockquote>