title: Resource not found error when making list view
body: <p>In Android I am trying to make simple list, but my simple app crashes every time I run it with the same error. Here is my code of main file</p>
  
  <pre><code>package com.example.test;
  
  import java.util.ArrayList;
  
  import android.os.Bundle;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  import android.app.Activity;
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          ListView lv=(ListView)findViewById(R.id.listView1);
  
          ArrayList&lt;String&gt; country=new ArrayList&lt;String&gt;();
          country.add("aaaaa");
          country.add("aaaaa");
          country.add("aaaaa");
  
          ArrayAdapter&lt;String&gt; adapter=new ArrayAdapter&lt;String&gt;(getApplicationContext(),R.id.listView1,country);
          lv.setAdapter(adapter);
  
      }
  
  
  
  }
  </code></pre>
  
  <p>and my xml file is like</p>
  
  <pre><code>&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=".MainActivity" &gt;
  
      &lt;ListView
          android:id="@+id/listView1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:layout_marginLeft="28dp"
          android:layout_marginTop="47dp" &gt;
      &lt;/ListView&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>now the error which i get in log cat is.</p>
  
  <pre><code>07-15 18:09:22.235: E/AndroidRuntime(1202): FATAL EXCEPTION: main
  07-15 18:09:22.235: E/AndroidRuntime(1202): android.content.res.Resources$NotFoundException: Resource ID #0x7f080000 type #0x12 is not valid
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.content.res.Resources.loadXmlResourceParser(Resources.java:2144)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.content.res.Resources.getLayout(Resources.java:853)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:371)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.widget.AbsListView.obtainView(AbsListView.java:2159)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1246)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.widget.ListView.onMeasure(ListView.java:1158)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.View.measure(View.java:15518)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.widget.RelativeLayout.measureChild(RelativeLayout.java:666)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:477)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.View.measure(View.java:15518)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.View.measure(View.java:15518)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:847)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.View.measure(View.java:15518)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2176)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.View.measure(View.java:15518)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1874)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1089)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1265)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.Choreographer.doCallbacks(Choreographer.java:562)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.Choreographer.doFrame(Choreographer.java:532)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.os.Handler.handleCallback(Handler.java:725)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.os.Handler.dispatchMessage(Handler.java:92)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.os.Looper.loop(Looper.java:137)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at android.app.ActivityThread.main(ActivityThread.java:5041)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at java.lang.reflect.Method.invokeNative(Native Method)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at java.lang.reflect.Method.invoke(Method.java:511)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
  07-15 18:09:22.235: E/AndroidRuntime(1202):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>I read a lot about this resource not found error and did every trick but it didn't work. I removed R file, Cleaned project, make new project but failed.</p>