title: java.lang.OutOfMemoryError- unable to open a second activity
body: <p>So I had the <code>java.lang.OutOfMemoryError</code> error, and was unable to open my app. I added <code>android:hardwareAccelerated="false" and android:largeHeap="true"</code> to the AndroidManifest.xml, but now I'm unable to open my next activity when clicking on a button. The app will crash with the below error. The second activity has one image, 2 text views and 5 buttons.</p>
  
  <pre><code>11-05 04:33:17.420 15163-15163/? E/Zygote: v2
  11-05 04:33:17.430 15163-15163/? E/Zygote: accessInfo : 0
  11-05 04:33:22.670 15163- 
  15163/dev.ddc.josephsiccita.diamonddancechallenge E/AndroidRuntime: FATAL EXCEPTION: main
      Process: dev.ddc.josephsiccita.diamonddancechallenge, PID: 15163
      java.lang.OutOfMemoryError: Failed to allocate a 568189452 byte allocation with 16765568 free bytes and 357MB until OOM
          at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
          at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
          at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:856)
          at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:675)
          at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:2228)
          at android.content.res.Resources.loadDrawableForCookie(Resources.java:4211)
          at android.content.res.Resources.loadDrawable(Resources.java:4085)
          at android.content.res.Resources.getDrawable(Resources.java:2005)
          at android.content.res.Resources.getDrawable(Resources.java:1987)
          at android.content.Context.getDrawable(Context.java:464)
          at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:463)
          at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:203)
          at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:191)
          at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:102)
          at android.support.v7.widget.AppCompatImageHelper.loadFromAttributes(AppCompatImageHelper.java:59)
          at android.support.v7.widget.AppCompatImageView.&lt;init&gt;(AppCompatImageView.java:78)
          at android.support.v7.widget.AppCompatImageView.&lt;init&gt;(AppCompatImageView.java:68)
          at android.support.v7.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:182)
          at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:106)
          at android.support.v7.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1266)
          at android.support.v7.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1316)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:758)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:847)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:527)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:380)
          at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
          at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
          at dev.ddc.josephsiccita.diamonddancechallenge.Main2Activity.onCreate(Main2Activity.java:20)
          at android.app.Activity.performCreate(Activity.java:6876)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
          at android.app.ActivityThread.access$1100(ActivityThread.java:221)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:158)
          at android.app.ActivityThread.main(ActivityThread.java:7224)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
  </code></pre>