title: Error inflating imageview in scrollview android
body: <p>I tried to have a scrolling image in my android app but have this error in my debugger:</p>
  <p><code>Binary xml error in line 10 :inflating android widget imageview</code></p>
  <p>This the xml code</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  android:layout_width=&quot;match_parent&quot;
  android:layout_height=&quot;match_parent&quot;
  android:background=&quot;@drawable/bgabout&quot;&gt;
   &lt;ScrollView
   android:layout_width=&quot;wrap_content&quot;
   android:layout_height=&quot;wrap_content&quot;
    &gt;
     &lt;ImageView 
       android:layout_width=&quot;wrap_content&quot; 
       android:layout_height=&quot;wrap_content&quot;
       android:background=&quot;@drawable/aboutscroll&quot; /&gt;   
   &lt;/ScrollView&gt;
      
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>And this is the stack trace:</p>
  <blockquote>
  <p>08-26 11:43:58.102: E/AndroidRuntime(24553): FATAL EXCEPTION: main 08-26 11:43:58.102:</p>
  <p>E/AndroidRuntime(24553): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.albir/com.example.albir.About}: android.view.InflateException: Binary XML file line #10: Error inflating class android.widget.ImageView</p>
  </blockquote>
  <p>i used the guidelines and i maked same changes so now i can scroll only image that had 700*1900 px rather than this large the debuguer show this trace :exception out of memory this the code :</p>
  <pre><code>&lt;HorizontalScrollView
          android:id=&quot;@+id/horizontalScrollView1&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot; &gt;
     
          &lt;ScrollView
                  android:id=&quot;@+id/scrollView1&quot;
                  android:layout_width=&quot;match_parent&quot;
                  android:layout_height=&quot;wrap_content&quot; &gt;
                  &lt;ImageView
                      android:id=&quot;@+id/imageView1&quot;
                      android:layout_width=&quot;wrap_content&quot;
                      android:layout_height=&quot;wrap_content&quot;/&gt;
              &lt;/ScrollView&gt;
    &lt;/HorizontalScroll&gt;
  </code></pre>
  <p>the java class</p>
  <pre><code>public class About extends Activity {
      
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          setContentView(R.layout.about);
          ImageView iv = (ImageView) findViewById(R.id.imageView1);
  
          
          Resources res = getResources();
          BitmapDrawable bitmap = (BitmapDrawable) res.
               getDrawable(R.drawable.aboutscroll);
          int imgW = bitmap.getIntrinsicWidth();
          int imgH = bitmap.getIntrinsicHeight();
              
          iv.setImageDrawable(bitmap);
              
          ViewGroup.LayoutParams params = (ViewGroup.LayoutParams) iv.getLayoutParams();
          params.width = imgW;
          params.height = imgH;
      }
  
     
  }
  </code></pre>
  <p>i want to know if i can modify this code to show more large image</p>