"Unable to instantiate activity ComponentInfo" plus
<p>Force close during activity setup due to null pointer exception.</p>

<h2>error log:</h2>

<pre><code>08-02 12:50:33.913: E/main(383): Birds clicked on - new activity starting....id
08-02 12:55:22.977: D/AndroidRuntime(383): Shutting down VM
08-02 12:55:22.977: W/dalvikvm(383): threadid=1: thread exiting with uncaught exception (group=0x40015560)
08-02 12:55:23.104: E/AndroidRuntime(383): FATAL EXCEPTION: main
08-02 12:55:23.104: E/AndroidRuntime(383): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.kissta.safari/com.kissta.safari.viewscreen}: java.lang.NullPointerException
08-02 12:55:23.104: E/AndroidRuntime(383):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
08-02 12:55:23.104: E/AndroidRuntime(383):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-02 12:55:23.104: E/AndroidRuntime(383):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-02 12:55:23.104: E/AndroidRuntime(383):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-02 12:55:23.104: E/AndroidRuntime(383):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-02 12:55:23.104: E/AndroidRuntime(383):  at android.os.Looper.loop(Looper.java:130)
08-02 12:55:23.104: E/AndroidRuntime(383):  at android.app.ActivityThread.main(ActivityThread.java:3683)
08-02 12:55:23.104: E/AndroidRuntime(383):  at java.lang.reflect.Method.invokeNative(Native Method)
08-02 12:55:23.104: E/AndroidRuntime(383):  at java.lang.reflect.Method.invoke(Method.java:507)
08-02 12:55:23.104: E/AndroidRuntime(383):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-02 12:55:23.104: E/AndroidRuntime(383):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-02 12:55:23.104: E/AndroidRuntime(383):  at dalvik.system.NativeStart.main(Native Method)
08-02 12:55:23.104: E/AndroidRuntime(383): Caused by: java.lang.NullPointerException
08-02 12:55:23.104: E/AndroidRuntime(383):  at android.app.Activity.findViewById(Activity.java:1647)
08-02 12:55:23.104: E/AndroidRuntime(383):  at com.kissta.safari.viewscreen.&lt;init&gt;(viewscreen.java:125)
08-02 12:55:23.104: E/AndroidRuntime(383):  at java.lang.Class.newInstanceImpl(Native Method)
08-02 12:55:23.104: E/AndroidRuntime(383):  at java.lang.Class.newInstance(Class.java:1409)
08-02 12:55:23.104: E/AndroidRuntime(383):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
08-02 12:55:23.104: E/AndroidRuntime(383):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
08-02 12:55:23.104: E/AndroidRuntime(383):  ... 11 more
</code></pre>

<h2>Based on log commands, my app seems to fail when opening either viewscreen or viewxml:</h2>

<pre><code>// ...abridged...import android.widget.ImageButton; 

public class main extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.mainxml);

// ... abridged
ImageButton ibone = (ImageButton) findViewById(R.id.imageButton1);
ibone.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                Intent explicitIntent1 = new Intent(main.this,viewscreen.class);
                explicitIntent1.putExtra("id", 1);
                startActivity(explicitIntent1);
                Log.e("main", "Birds clicked on - new activity starting...." + "id");
            }
        });


....further abridged...
</code></pre>

<p>Manifest:
    </p>

<pre><code>&lt;uses-sdk
    android:minSdkVersion="8"/&gt;

&lt;application
    android:icon="@drawable/iconanimal"
    android:label="@string/app_name"
    android:screenOrientation="landscape"
    android:theme="@style/Theme.Transparent" &gt;
    &lt;activity
        android:name=".splash"
        android:label="@string/title_activity_main" &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;activity
        android:name=".main"
        android:label="@string/app_name"
        android:screenOrientation="landscape" &gt;
    &lt;/activity&gt;
    &lt;activity
        android:name=".viewscreen"
        android:label="@string/app_name"
        android:screenOrientation="landscape" &gt;
&lt;/activity&gt;

&lt;/application&gt;

&lt;/manifest&gt;
</code></pre>

<h2>In the viewscreen activity:</h2>

<pre><code>package com.kissta.safari;

import java.util.ArrayList;

import android.app.Activity;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.ViewSwitcher;

public class viewscreen extends Activity implements OnClickListener,
    OnGestureListener {

// references to our image
private animals animalclass = new animals();

int TotalAnimals; // starting from 0 of course (so an 11=12 fruit)
int currentAnimal = 0;

boolean active = true;
long starttime = System.currentTimeMillis();
long timedelay = 50;

ArrayList&lt;Integer&gt; imagearray = new ArrayList&lt;Integer&gt;();
ArrayList&lt;Integer&gt; soundarray = new ArrayList&lt;Integer&gt;();
// ArrayList&lt;String&gt; printarray = new ArrayList&lt;String&gt;();

private ViewSwitcher switcher;
private GestureDetector gesturedetector;
public boolean viewone = true;
public int menuoption;
Handler myHandler = new Handler();

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.e("viewscreen1", "xml loading"); // does not reach here
    setContentView(R.layout.viewxml);
</code></pre>

<p>The log msg above is never triggered, implying to me that viewxml.xml is never reached(???).</p>

<p>Here is viewxml.xml:</p>

<pre><code>`&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- Note:  Can't add more than 2 views to a ViewSwitcher --&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fullscreenrelative"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
&gt;

&lt;ViewSwitcher
    android:id="@+id/viewSwitcher"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_above="@+id/bottomtablerow"
    android:layout_centerHorizontal="true"
    android:layout_gravity="center_horizontal|top"
    android:inAnimation="@anim/in_animation"
    android:outAnimation="@anim/out_animation" &gt;

    &lt;RelativeLayout
        android:id="@+id/view1relative"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center_horizontal"
        android:background="@drawable/swan"
        android:gravity="center_horizontal" &gt;

        &lt;ImageView
            android:id="@+id/view1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/clear32" /&gt;
    &lt;/RelativeLayout&gt;

    &lt;RelativeLayout
        android:id="@+id/view2relative"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center_horizontal"
        android:background="@drawable/kangaroo" &gt;

        &lt;ImageView
            android:id="@+id/view2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"

            android:src="@drawable/clear32" /&gt;
    &lt;/RelativeLayout&gt;
&lt;/ViewSwitcher&gt;

&lt;TableRow
    android:id="@+id/bottomtablerow"
    android:layout_width="fill_parent"
    android:layout_height="48dp"
    android:layout_alignParentBottom="true"
    android:background="#303030"
    android:gravity="center_horizontal" &gt;

    &lt;ImageButton
        android:id="@+id/btnPrevious"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="left|center_vertical"
        android:layout_weight=".2"
        android:background="@drawable/whiteleft"
        android:textStyle="bold" /&gt;

    &lt;ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight=".1"
        android:src="@drawable/clear" /&gt;

    &lt;TextView
        android:id="@+id/textll"
        android:layout_width="wrap_content"
        android:layout_height="44dp"
        android:layout_gravity="center_horizontal|top"
        android:layout_weight="1"
        android:gravity="center"
        android:includeFontPadding="false"
        android:padding="10dip"
        android:text="@string/app_name"
        android:textColor="#FFFFFF"
        android:textSize="25sp" /&gt;

    &lt;ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight=".1"
        android:src="@drawable/clear" /&gt;

    &lt;ImageButton
        android:id="@+id/btnNext"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right|center_vertical"
        android:layout_weight=".2"
        android:background="@drawable/whiteright"
        android:textStyle="bold" /&gt;
&lt;/TableRow&gt;

&lt;/RelativeLayout&gt;`
</code></pre>

<p>PS I am now also getting an AVD error which may be unrelated:
"emulator: ERROR: Could not load OpenGLES emulation library: Could not load DLL!"
I don't believe I am using OpenGL at all though.
see common bug report at <a href="http://code.google.com/p/android/issues/detail?id=33336" rel="nofollow">http://code.google.com/p/android/issues/detail?id=33336</a></p>

<p>PSS my app is also rejecting the use of non-google api VMs</p>

<p>PSS here is the full main file as requested:
    package com.kissta.safari;</p>

<pre><code>import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;

public class main extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.mainxml);
    // android:tileMode="repeat"

    Log.e("main", "main all good");

    SoundManager.getInstance();
    SoundManager.initSounds(main.this);
    SoundManager.loadSounds();
    Log.e("main", "sm LoadSounds worked, all done.");

        // SECTION FOR GAME CHOICE BUTTONS!!!!!!!!!
        // ***
        ImageButton ibone = (ImageButton) findViewById(R.id.imageButton1);
        ibone.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                Intent explicitIntent1 = new Intent(main.this,viewscreen.class);
                explicitIntent1.putExtra("id", 1);
                startActivity(explicitIntent1);
                Log.e("main", "Birds clicked on - new activity starting...." + "id"); // it gets this far perfectly fine
            }
        });

        // ***

        ImageButton ibtwo = (ImageButton) findViewById(R.id.imageButton2);
        ibtwo.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                Playsound2.stop();
                Intent explicitIntent2 = new Intent(main.this,
                        viewscreen.class);
                explicitIntent2.putExtra("id", 2);
                startActivity(explicitIntent2);
            }
        });

        // ***

        ImageButton ibthree = (ImageButton) findViewById(R.id.imageButton3);
        ibthree.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                Playsound2.stop();
                Intent explicitIntent3 = new Intent(main.this,
                        viewscreen.class);
                explicitIntent3.putExtra("id", 3);
                startActivity(explicitIntent3);
            }
        });

        // ***

        ImageButton ibfour = (ImageButton) findViewById(R.id.imageButton4);
        ibfour.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                Playsound2.stop();
                Intent explicitIntent4 = new Intent(main.this,
                        viewscreen.class);
                explicitIntent4.putExtra("id", 4);
                startActivity(explicitIntent4);
            }
        });

        ImageButton ibfive = (ImageButton) findViewById(R.id.imageButton5);
        ibfive.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                Playsound2.stop();
                Intent explicitIntent5 = new Intent(main.this,
                        viewscreen.class);
                explicitIntent5.putExtra("id", 5);
                startActivity(explicitIntent5);
            }
        });

        ImageButton ibsix = (ImageButton) findViewById(R.id.imageButton6); // settings - adjust
        ibsix.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                Playsound2.stop();
                Intent explicitIntent6 = new Intent(main.this,
                        viewscreen.class);
                explicitIntent6.putExtra("id", 6);
                startActivity(explicitIntent6);
            }
        });

        ImageButton ibsev = (ImageButton) findViewById(R.id.imageButtonau); // settings - adjust
        ibsev.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                Playsound2.stop();
                Intent explicitIntent6 = new Intent(main.this,
                        viewscreen.class);
                explicitIntent6.putExtra("id", 7);
                startActivity(explicitIntent6);
            }
        });




        // / *************** END OF GAME CHOICE BUTTONS


    }



}
</code></pre>
