Java code android process stopped
<p>i create my app . i have loadscreen>menu>menu 2 . when i choose menu 2 i have error . that my process stopped . my java code of menu 2:
i made menu 2 java script like in menu 1 . menu 1 works but menu 2 no . where my mistake ?</p>

<pre><code>package com.lineage.goddess;

import android.app.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;


public class l2class extends Activity {

    private static final int SHOW_1 = 1;
    private static final int SHOW_2 = 2;
    private static final int SHOW_3 = 3;
    private static final int SHOW_4 = 4;
    private static final int SHOW_5 = 5;
    private static final int SHOW_6 = 6;
    private static final int SHOW_7 = 7;
    private static final int SHOW_8 = 8;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.menu);
        Button act8 = (Button)findViewById(R.id.button8);
        act8.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent i = new Intent(l2class.this, wynnsummoner.class);
                startActivityForResult(i, SHOW_8);
                }
            });
        Button act7 = (Button)findViewById(R.id.button7);
        act7.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent i = new Intent(l2class.this, eolhhealer.class);
                startActivityForResult(i, SHOW_7);
                }
            });
        Button act6 = (Button)findViewById(R.id.button6);
        act6.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent i = new Intent(l2class.this, sigelknight.class);
                startActivityForResult(i, SHOW_6);
                }
            });
        Button act5 = (Button)findViewById(R.id.button5);
        act5.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent i = new Intent(l2class.this, isenchanter.class);
                startActivityForResult(i, SHOW_5);
                }
            });
        Button act4 = (Button)findViewById(R.id.button4);
        act4.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent i = new Intent(l2class.this, othelrogue.class);
                startActivityForResult(i, SHOW_4);
                }
            });
        Button act3 = (Button)findViewById(R.id.button3);
        act3.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent i = new Intent(l2class.this, tirwarrior.class);
                startActivityForResult(i, SHOW_3);
                }
            });
        Button act2 = (Button)findViewById(R.id.button2);
        act2.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent i = new Intent(l2class.this, yrarcher.class);
                startActivityForResult(i, SHOW_2);
                }
            });
        Button act1 = (Button)findViewById(R.id.button1);
        act1.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent i = new Intent(l2class.this, feohwizard.class);
                startActivityForResult(i, SHOW_1);
                }
            });
        }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == Activity.RESULT_OK) {
            switch (requestCode) {

                case SHOW_1://case show_1

                    break;
                case SHOW_2://case show_2

                    break;
                case SHOW_3://case show_3

                    break;
                case SHOW_4://case show_4
                    break;
                case SHOW_5://case show_5
                    break;
                case SHOW_6://case show_6
                    break;
                case SHOW_7://case show_7
                    break;
                case SHOW_8://case show_8



                    break;

                }//switch
            }//if result_ok
        }//onactivityresult


    //TODO: Fill In Methods Etc.
    }//class
</code></pre>

<p>Menu 1:</p>

<pre><code>package com.lineage.goddess;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

public class menu extends Activity {

    private static final int SHOW_1 = 1;
    private static final int SHOW_2 = 2;
    private static final int SHOW_3 = 3;
    private static final int SHOW_4 = 4;

    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.menu);
        Button act4 = (Button)findViewById(R.id.button2);
        act4.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent i = new Intent(menu.this, l2class.class);
                startActivityForResult(i, SHOW_4);
                }
            });
        Button act3 = (Button)findViewById(R.id.button3);
        act3.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent i = new Intent(menu.this, location.class);
                startActivityForResult(i, SHOW_3);
                }
            });
        Button act2 = (Button)findViewById(R.id.button4);
        act2.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent i = new Intent(menu.this, help.class);
                startActivityForResult(i, SHOW_2);
                }
            });
        Button act1 = (Button)findViewById(R.id.button1);
        act1.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent i = new Intent(menu.this, room.class);
                startActivityForResult(i, SHOW_1);
                }
            });
        }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == Activity.RESULT_OK) {
            switch (requestCode) {

                case SHOW_1://case show_1

                    break;
                case SHOW_2://case show_2

                    break;
                case SHOW_3://case show_3

                    break;
                case SHOW_4://case show_4

                    break;

                }//switch
            }//if result_ok
        }//onactivityresult


    //TODO: Fill In Methods Etc.
    }//class
</code></pre>

<p>Logcat :</p>

<pre><code>12-22 22:19:12.493: E/AndroidRuntime(300): FATAL EXCEPTION: main
12-22 22:19:12.493: E/AndroidRuntime(300): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lineage.goddess/com.lineage.goddess.l2class}: java.lang.NullPointerException
12-22 22:19:12.493: E/AndroidRuntime(300): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lineage.goddess/com.lineage.goddess.l2class}: java.lang.NullPointerException
12-22 22:19:12.493: E/AndroidRuntime(300):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
12-22 22:19:12.493: E/AndroidRuntime(300):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-22 22:19:12.493: E/AndroidRuntime(300):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-22 22:19:12.493: E/AndroidRuntime(300):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-22 22:19:12.493: E/AndroidRuntime(300):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-22 22:19:12.493: E/AndroidRuntime(300):  at android.os.Looper.loop(Looper.java:123)
12-22 22:19:12.493: E/AndroidRuntime(300):  at android.app.ActivityThread.main(ActivityThread.java:4627)
12-22 22:19:12.493: E/AndroidRuntime(300):  at java.lang.reflect.Method.invokeNative(Native Method)
12-22 22:19:12.493: E/AndroidRuntime(300):  at java.lang.reflect.Method.invoke(Method.java:521)
12-22 22:19:12.493: E/AndroidRuntime(300):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-22 22:19:12.493: E/AndroidRuntime(300):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-22 22:19:12.493: E/AndroidRuntime(300):  at dalvik.system.NativeStart.main(Native Method)
12-22 22:19:12.493: E/AndroidRuntime(300): Caused by: java.lang.NullPointerException
12-22 22:19:12.493: E/AndroidRuntime(300):  at com.lineage.goddess.l2class.onCreate(l2class.java:32)
12-22 22:19:12.493: E/AndroidRuntime(300):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-22 22:19:12.493: E/AndroidRuntime(300):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
12-22 22:19:12.493: E/AndroidRuntime(300):  ... 11 more
</code></pre>

<p>i found my mistake : setContentView(R.layout.menu); need setContentView(R.layout.l2class); 
i fixed it . because i dont have menu.xml . i have l2class.xml</p>
