title: onclicklistener function onclick crashes
body: <p>From some reason my Application crashes when I cLick the <code>Button</code>. I searched
  in the Internet and everything seems good. 
  I wil appreciate your advice to help me find out what's wrong.
  This is the first Java which I click the <code>Button</code>.
  I'd like to know what is the problem.Thanks</p>
  
  <pre><code> package nir.rauc.mapstutori;
      import android.app.Activity;
      import android.content.Intent;
      import android.os.Bundle;
      import android.view.View;
      import android.view.View.OnClickListener;
      import android.widget.Button;
  
      public class Details extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_details);
      final   Button button1 = (Button) findViewById(R.id.button1);
          button1.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent(Details.this, Pictures.class);
                  startActivity(intent);
              }
  
          });
      }
      }
  </code></pre>
  
  <p><strong>acitivty_details.xml</strong></p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:background="#FF00FF00" &gt;
  
      &lt;TextView
          android:id="@+id/textView1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:layout_marginLeft="38dp"
          android:layout_marginTop="60dp"
          android:text="price : 2.4 M "
          android:textSize="40sp" /&gt;
  
      &lt;Button
          android:id="@+id/button1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_alignRight="@+id/textView1"
          android:layout_marginBottom="31dp"
          android:background="#4004F0"
          android:text="Click to Check for pictures" /&gt;
  
      &lt;TextView
          android:id="@+id/textView2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_below="@+id/textView1"
          android:layout_marginTop="44dp"
          android:text="Street: Biking botoom"
          android:textSize="40sp" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The Second Jave FIle:</p>
  
  <pre><code>  package nir.rauc.mapstutori;
  
      import android.app.Activity;
      import android.os.Bundle;
  
      public class Pictures extends Activity {
  
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.picturescroll);
          }
      }
  </code></pre>
  
  <p><strong>picturescroll.xml</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:orientation="vertical" &gt;
      &lt;HorizontalScrollView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:fillViewport="true"
          android:scrollbars="horizontal|vertical" &gt;
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:orientation="horizontal" &gt;
  
              &lt;ImageView
                  android:id="@+id/viewImage1"
                  android:layout_width="125dp"
                  android:layout_height="125dp"
                  android:padding="15dp"
                  android:src="@drawable/first" /&gt;
  
              &lt;ImageView
                  android:id="@+id/viewImage2"
                  android:layout_width="125dp"
                  android:layout_height="125dp"
                  android:padding="15dp"
                  android:src="@drawable/second" /&gt;
  
              &lt;ImageView
                  android:id="@+id/viewImage3"
                  android:layout_width="125dp"
                  android:layout_height="125dp"
                  android:padding="15dp"
                  android:src="@drawable/third" /&gt;
  
  
          &lt;/LinearLayout&gt;
      &lt;/HorizontalScrollView&gt;
  
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>EDITED:MyManifest</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="nir.rauc.mapstutori"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true" /&gt;
  
      &lt;uses-sdk
          android:minSdkVersion="11"
          android:targetSdkVersion="18" /&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;meta-data
              android:name="com.google.android.gms.version"
              android:value="@integer/google_play_services_version" /&gt;
  
          &lt;activity
              android:name="nir.rauc.mapstutori.MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;meta-data
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="CANTWRITHEITONSTACKOVERFLOW" /&gt;
  
          &lt;activity
              android:name="nir.rauc.mapstutori.Details"
              android:label="@string/title_activity_details" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="nir.rauc.mapstutori.Pictures"
              android:label="something" &gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>EDITED:Logtag</p>
  
  <pre><code>04-11 22:16:05.631: E/dalvikvm-heap(12095): Out of memory on a 53934352-byte allocation.
  04-11 22:16:05.656: E/AndroidRuntime(12095): FATAL EXCEPTION: main
  04-11 22:16:05.656: E/AndroidRuntime(12095): java.lang.RuntimeException: Unable to start activity ComponentInfo{nir.rauc.mapstutori/nir.rauc.mapstutori.Pictures}: android.view.InflateException: Binary XML file line #33: Error inflating class &lt;unknown&gt;
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.app.ActivityThread.access$700(ActivityThread.java:159)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.os.Handler.dispatchMessage(Handler.java:99)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.os.Looper.loop(Looper.java:137)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.app.ActivityThread.main(ActivityThread.java:5419)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at java.lang.reflect.Method.invokeNative(Native Method)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at java.lang.reflect.Method.invoke(Method.java:525)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at dalvik.system.NativeStart.main(Native Method)
  04-11 22:16:05.656: E/AndroidRuntime(12095): Caused by: android.view.InflateException: Binary XML file line #33: Error inflating class &lt;unknown&gt;
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.view.LayoutInflater.createView(LayoutInflater.java:626)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:675)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.app.Activity.setContentView(Activity.java:1956)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at nir.rauc.mapstutori.Pictures.onCreate(Pictures.java:11)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.app.Activity.performCreate(Activity.java:5372)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    ... 11 more
  04-11 22:16:05.656: E/AndroidRuntime(12095): Caused by: java.lang.reflect.InvocationTargetException
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at java.lang.reflect.Constructor.constructNative(Native Method)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.view.LayoutInflater.createView(LayoutInflater.java:600)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    ... 26 more
  04-11 22:16:05.656: E/AndroidRuntime(12095): Caused by: java.lang.OutOfMemoryError
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:832)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.content.res.Resources.loadDrawable(Resources.java:2988)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.widget.ImageView.&lt;init&gt;(ImageView.java:131)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    at android.widget.ImageView.&lt;init&gt;(ImageView.java:121)
  04-11 22:16:05.656: E/AndroidRuntime(12095):    ... 29 more
  </code></pre>