Resource not found error, Android application

1.6k Views Asked by At

I am trying to switch between screens of an Android app. The first screen loads up perfectly but instead of loading the next screen, the app crashes and I get the message saying the app has stopped. I went through the logcat and saw a ResourceNotFoundException error. Any comments as to how I go about fixing this error?

Here's my Main class

   public class MainActivity extends Activity {
     /** Called when activity is first created. */
   @Override
          protected void onCreate(Bundle savedInstanceState){
              super.onCreate(savedInstanceState);
              setContentView(R.layout.splash);

           Handler x = new Handler();
           x.postDelayed(new SplashHandler(), 5000);
           }

                 class SplashHandler implements Runnable{
                 public void run(){
                 Intent myIntent = new Intent(MainActivity.this, Main.class);
                 startActivity(myIntent);
            }
         }
      }

Here's the class for the next screen

       public class Main extends Activity{
           protected void onCreate(Bundle savedInstanceState){
           super.onCreate(savedInstanceState);
           setContentView(R.layout.main);   

          }
     } 

First xml file

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#393131" >

<ImageView
android:id="@+id/museum_logo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/museum_logo" />

</RelativeLayout>

second xml file

<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@style/AppBaseTheme"
android:orientation="horizontal" >

<ImageButton
    android:id="@+id/scan"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/scan" />

<ImageButton
    android:id="@+id/manual"
    android:layout_width="120dp"
    android:layout_height="match_parent"
    android:src="@drawable/manual" />

<ImageButton
    android:id="@+id/history"
    android:layout_width="109dp"
    android:layout_height="wrap_content"
    android:src="@drawable/history" />

</AbsoluteLayout>

manifest file,

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.museumapp"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="21" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
           <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:label="@string/app_name" android:name="Main">

    </activity>
</application>

log cat

 11-23 11:43:54.954: I/ActivityManager(15232): Timeline: Activity_launch_request id:com.example.museumapp time:5745841
11-23 11:43:54.974: D/AndroidRuntime(15232): Shutting down VM
11-23 11:43:54.974: W/dalvikvm(15232): threadid=1: thread exiting with uncaught exception (group=0x42026d88)
11-23 11:43:55.004: E/AndroidRuntime(15232): FATAL EXCEPTION: main
11-23 11:43:55.004: E/AndroidRuntime(15232): Process: com.example.museumapp, PID: 15232
11-23 11:43:55.004: E/AndroidRuntime(15232): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.museumapp/com.example.museumapp.Main}: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.AbsoluteLayout
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2237)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2286)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.app.ActivityThread.access$800(ActivityThread.java:144)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.os.Handler.dispatchMessage(Handler.java:102)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.os.Looper.loop(Looper.java:212)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.app.ActivityThread.main(ActivityThread.java:5135)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at java.lang.reflect.Method.invokeNative(Native Method)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at java.lang.reflect.Method.invoke(Method.java:515)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at dalvik.system.NativeStart.main(Native Method)
11-23 11:43:55.004: E/AndroidRuntime(15232): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.AbsoluteLayout
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.view.LayoutInflater.createView(LayoutInflater.java:620)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:297)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.app.Activity.setContentView(Activity.java:1929)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at com.example.museumapp.Main.onCreate(Main.java:9)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.app.Activity.performCreate(Activity.java:5231)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2201)
11-23 11:43:55.004: E/AndroidRuntime(15232):    ... 11 more
11-23 11:43:55.004: E/AndroidRuntime(15232): Caused by: java.lang.reflect.InvocationTargetException
11-23 11:43:55.004: E/AndroidRuntime(15232):    at java.lang.reflect.Constructor.constructNative(Native Method)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.view.LayoutInflater.createView(LayoutInflater.java:594)
11-23 11:43:55.004: E/AndroidRuntime(15232):    ... 23 more
11-23 11:43:55.004: E/AndroidRuntime(15232): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f0b008b a=-1 r=0x7f0b008b}
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.content.res.Resources.loadDrawable(Resources.java:2087)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.view.View.<init>(View.java:3685)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.view.View.<init>(View.java:3615)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.view.ViewGroup.<init>(ViewGroup.java:464)
11-23 11:43:55.004: E/AndroidRuntime(15232):    at android.widget.AbsoluteLayout.<init>(AbsoluteLayout.java:47)
11-23 11:43:55.004: E/AndroidRuntime(15232):    ... 26 more
11-23 11:48:55.056: I/Process(15232): Sending signal. PID: 15232 SIG: 9
11-23 12:07:46.180: D/dalvikvm(16221): GC_FOR_ALLOC freed 56K, 15% free 50538K/58952K, paused 22ms, total 23ms
11-23 12:07:46.300: I/dalvikvm-heap(16221): Grow heap (frag case) to 99.712MB for 51948016-byte allocation
11-23 12:07:46.400: I/Adreno-EGL(16221): <qeglDrvAPI_eglInitialize:381>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_KK_2.7_RB1.04.04.04.007.064_msm8960_KK_2.7_RB1__release_AU ()
11-23 12:07:46.400: I/Adreno-EGL(16221): OpenGL ES Shader Compiler Version: 17.01.12.SPL
11-23 12:07:46.400: I/Adreno-EGL(16221): Build Date: 07/01/14 Tue
11-23 12:07:46.400: I/Adreno-EGL(16221): Local Branch: 
11-23 12:07:46.400: I/Adreno-EGL(16221): Remote Branch: quic/kk_2.7_rb1.41
11-23 12:07:46.400: I/Adreno-EGL(16221): Local Patches: NONE
11-23 12:07:46.400: I/Adreno-EGL(16221): Reconstruct Branch: AU_LINUX_ANDROID_KK_2.7_RB1.04.04.04.007.064 +  NOTHING
11-23 12:07:46.460: D/OpenGLRenderer(16221): Enabling debug mode 0
11-23 12:07:47.221: I/ActivityManager(16221): Timeline: Activity_idle id: android.os.BinderProxy@451b7e60 time:7178105
11-23 12:07:50.124: I/ActivityManager(16221): Timeline: Activity_idle id: android.os.BinderProxy@451b7e60 time:7181014
11-23 12:07:51.365: I/ActivityManager(16221): Timeline: Activity_launch_request id:com.example.museumapp time:7182259
11-23 12:07:51.405: D/AndroidRuntime(16221): Shutting down VM
11-23 12:07:51.405: W/dalvikvm(16221): threadid=1: thread exiting with uncaught exception (group=0x42026d88)
11-23 12:07:51.435: E/AndroidRuntime(16221): FATAL EXCEPTION: main
11-23 12:07:51.435: E/AndroidRuntime(16221): Process: com.example.museumapp, PID: 16221
11-23 12:07:51.435: E/AndroidRuntime(16221): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.museumapp/com.example.museumapp.Main}: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.AbsoluteLayout
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2237)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2286)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.app.ActivityThread.access$800(ActivityThread.java:144)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.os.Handler.dispatchMessage(Handler.java:102)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.os.Looper.loop(Looper.java:212)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.app.ActivityThread.main(ActivityThread.java:5135)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at java.lang.reflect.Method.invokeNative(Native Method)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at java.lang.reflect.Method.invoke(Method.java:515)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at dalvik.system.NativeStart.main(Native Method)
11-23 12:07:51.435: E/AndroidRuntime(16221): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.AbsoluteLayout
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.view.LayoutInflater.createView(LayoutInflater.java:620)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:297)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.app.Activity.setContentView(Activity.java:1929)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at com.example.museumapp.Main.onCreate(Main.java:9)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.app.Activity.performCreate(Activity.java:5231)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2201)
11-23 12:07:51.435: E/AndroidRuntime(16221):    ... 11 more
11-23 12:07:51.435: E/AndroidRuntime(16221): Caused by: java.lang.reflect.InvocationTargetException
11-23 12:07:51.435: E/AndroidRuntime(16221):    at java.lang.reflect.Constructor.constructNative(Native Method)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.view.LayoutInflater.createView(LayoutInflater.java:594)
11-23 12:07:51.435: E/AndroidRuntime(16221):    ... 23 more
11-23 12:07:51.435: E/AndroidRuntime(16221): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f0b008b a=-1 r=0x7f0b008b}
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.content.res.Resources.loadDrawable(Resources.java:2087)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.view.View.<init>(View.java:3685)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.view.View.<init>(View.java:3615)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.view.ViewGroup.<init>(ViewGroup.java:464)
11-23 12:07:51.435: E/AndroidRuntime(16221):    at android.widget.AbsoluteLayout.<init>(AbsoluteLayout.java:47)
11-23 12:07:51.435: E/AndroidRuntime(16221):    ... 26 more
11-23 12:07:54.288: I/Process(16221): Sending signal. PID: 16221 SIG: 9
11-23 12:09:10.122: D/dalvikvm(17086): GC_FOR_ALLOC freed 68K, 15% free 50538K/58952K, paused 33ms, total 33ms
11-23 12:09:10.262: I/dalvikvm-heap(17086): Grow heap (frag case) to 99.712MB for 51948016-byte allocation
11-23 12:09:10.382: I/Adreno-EGL(17086): <qeglDrvAPI_eglInitialize:381>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_KK_2.7_RB1.04.04.04.007.064_msm8960_KK_2.7_RB1__release_AU ()
11-23 12:09:10.382: I/Adreno-EGL(17086): OpenGL ES Shader Compiler Version: 17.01.12.SPL
11-23 12:09:10.382: I/Adreno-EGL(17086): Build Date: 07/01/14 Tue
11-23 12:09:10.382: I/Adreno-EGL(17086): Local Branch: 
11-23 12:09:10.382: I/Adreno-EGL(17086): Remote Branch: quic/kk_2.7_rb1.41
11-23 12:09:10.382: I/Adreno-EGL(17086): Local Patches: NONE
11-23 12:09:10.382: I/Adreno-EGL(17086): Reconstruct Branch: AU_LINUX_ANDROID_KK_2.7_RB1.04.04.04.007.064 +  NOTHING
11-23 12:09:10.442: D/OpenGLRenderer(17086): Enabling debug mode 0
11-23 12:09:10.672: I/ActivityManager(17086): Timeline: Activity_idle id: android.os.BinderProxy@451baea8 time:7261563
11-23 12:09:15.357: I/ActivityManager(17086): Timeline: Activity_launch_request id:com.example.museumapp time:7266241
11-23 12:09:15.417: D/AndroidRuntime(17086): Shutting down VM
11-23 12:09:15.417: W/dalvikvm(17086): threadid=1: thread exiting with uncaught exception (group=0x42026d88)
11-23 12:09:15.457: E/AndroidRuntime(17086): FATAL EXCEPTION: main
11-23 12:09:15.457: E/AndroidRuntime(17086): Process: com.example.museumapp, PID: 17086
11-23 12:09:15.457: E/AndroidRuntime(17086): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.museumapp/com.example.museumapp.Main}: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.AbsoluteLayout
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2237)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2286)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.app.ActivityThread.access$800(ActivityThread.java:144)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.os.Handler.dispatchMessage(Handler.java:102)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.os.Looper.loop(Looper.java:212)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.app.ActivityThread.main(ActivityThread.java:5135)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at java.lang.reflect.Method.invokeNative(Native Method)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at java.lang.reflect.Method.invoke(Method.java:515)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at dalvik.system.NativeStart.main(Native Method)
11-23 12:09:15.457: E/AndroidRuntime(17086): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.AbsoluteLayout
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.view.LayoutInflater.createView(LayoutInflater.java:620)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:297)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.app.Activity.setContentView(Activity.java:1929)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at com.example.museumapp.Main.onCreate(Main.java:9)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.app.Activity.performCreate(Activity.java:5231)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2201)
11-23 12:09:15.457: E/AndroidRuntime(17086):    ... 11 more
11-23 12:09:15.457: E/AndroidRuntime(17086): Caused by: java.lang.reflect.InvocationTargetException
11-23 12:09:15.457: E/AndroidRuntime(17086):    at java.lang.reflect.Constructor.constructNative(Native Method)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.view.LayoutInflater.createView(LayoutInflater.java:594)
11-23 12:09:15.457: E/AndroidRuntime(17086):    ... 23 more
11-23 12:09:15.457: E/AndroidRuntime(17086): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f0b008b a=-1 r=0x7f0b008b}
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.content.res.Resources.loadDrawable(Resources.java:2087)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.view.View.<init>(View.java:3685)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.view.View.<init>(View.java:3615)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.view.ViewGroup.<init>(ViewGroup.java:464)
11-23 12:09:15.457: E/AndroidRuntime(17086):    at android.widget.AbsoluteLayout.<init>(AbsoluteLayout.java:47)
11-23 12:09:15.457: E/AndroidRuntime(17086):    ... 26 more
2

There are 2 best solutions below

4
On BEST ANSWER

In the manifest change

<activity android:label="@string/app_name" android:name="Main">

with

<activity android:label="@string/app_name" android:name=".Main">

I have added . before the Main

UPDATE

Delete the background attribute for the AbsoluteLayout in the second xml (main.xml)

android:background="@style/AppBaseTheme" 
0
On

The problem is in your second xml file. Reading the stacktrace carefully, one can find this :

android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.AbsoluteLayout
Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path)

This is caused by this line :

android:background="@style/AppBaseTheme"

You cannot use a style resource as background, you need to provide either a color or drawable resource (@android:color/white or @drawable/your_drawable for example). Alternatively, you can define the background in styles.xml and use the style on that AbsoluteLayout like this :

<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/LinearLayout1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    style="@style/AppBaseTheme"
    android:orientation="horizontal" >