Note that there are some explanatory texts on larger screens.

plurals
  1. POApp emulator crashes
    primarykey
    data
    text
    <p>Everytime I try to run the emulator it crashes. Here is the logCat I receive:</p> <pre><code>10-31 09:09:59.104: W/dalvikvm(1840): threadid=1: thread exiting with uncaught exception (group=0x414c4700) 10-31 09:09:59.453: E/AndroidRuntime(1840): FATAL EXCEPTION: main 10-31 09:09:59.453: E/AndroidRuntime(1840): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.secondapp/com.example.secondapp.MainActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class &lt;unknown&gt; 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.app.ActivityThread.access$600(ActivityThread.java:141) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.os.Handler.dispatchMessage(Handler.java:99) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.os.Looper.loop(Looper.java:137) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.app.ActivityThread.main(ActivityThread.java:5103) 10-31 09:09:59.453: E/AndroidRuntime(1840): at java.lang.reflect.Method.invokeNative(Native Method) 10-31 09:09:59.453: E/AndroidRuntime(1840): at java.lang.reflect.Method.invoke(Method.java:525) 10-31 09:09:59.453: E/AndroidRuntime(1840): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 10-31 09:09:59.453: E/AndroidRuntime(1840): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 10-31 09:09:59.453: E/AndroidRuntime(1840): at dalvik.system.NativeStart.main(Native Method) 10-31 09:09:59.453: E/AndroidRuntime(1840): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class &lt;unknown&gt; 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.view.LayoutInflater.createView(LayoutInflater.java:620) 10-31 09:09:59.453: E/AndroidRuntime(1840): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.view.LayoutInflater.inflate(LayoutInflater.java:469) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 10-31 09:09:59.453: E/AndroidRuntime(1840): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.app.Activity.setContentView(Activity.java:1895) 10-31 09:09:59.453: E/AndroidRuntime(1840): at com.example.secondapp.MainActivity.onCreate(MainActivity.java:19) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.app.Activity.performCreate(Activity.java:5133) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175) 10-31 09:09:59.453: E/AndroidRuntime(1840): ... 11 more 10-31 09:09:59.453: E/AndroidRuntime(1840): Caused by: java.lang.reflect.InvocationTargetException 10-31 09:09:59.453: E/AndroidRuntime(1840): at java.lang.reflect.Constructor.constructNative(Native Method) 10-31 09:09:59.453: E/AndroidRuntime(1840): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.view.LayoutInflater.createView(LayoutInflater.java:594) 10-31 09:09:59.453: E/AndroidRuntime(1840): ... 23 more 10-31 09:09:59.453: E/AndroidRuntime(1840): Caused by: java.lang.OutOfMemoryError 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:503) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:356) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:800) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.content.res.Resources.loadDrawable(Resources.java:2105) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.content.res.TypedArray.getDrawable(TypedArray.java:601) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.view.View.&lt;init&gt;(View.java:3364) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:457) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.widget.LinearLayout.&lt;init&gt;(LinearLayout.java:176) 10-31 09:09:59.453: E/AndroidRuntime(1840): at android.widget.LinearLayout.&lt;init&gt;(LinearLayout.java:172) 10-31 09:09:59.453: E/AndroidRuntime(1840): ... 26 more 10-31 09:09:59.643: D/dalvikvm(1840): GC_FOR_ALLOC freed 62704K, 96% free 2693K/65536K, paused 164ms, total 166ms 10-31 09:10:22.983: I/Process(1840): Sending signal. PID: 1840 SIG: 9 </code></pre> <p>this is my Java code:</p> <pre><code>package com.example.secondapp; import android.app.Activity; import android.content.Intent; import android.media.MediaPlayer; import android.os.Bundle; public class Splash extends Activity { MediaPlayer ourSong; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.splash); ourSong = MediaPlayer.create(Splash.this, R.raw.happyman); ourSong.start(); Thread timer = new Thread(){ public void run(){ try{ sleep(1000); } catch (InterruptedException e){ e.printStackTrace(); }finally{ Intent startMain = new Intent("com.example.secondapp.MainActivity"); startActivity(startMain); } } }; timer.start(); } @Override protected void onPause() { // TODO Auto-generated method stub super.onPause(); ourSong.release(); finish(); } </code></pre> <p>}</p> <p>I have tried everything tho fix it, but I can't seem to find the problem. Can anybody help me with this?</p> <p>Layout:</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="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/background1" </code></pre> <p>> </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload