Android: Option Menu
<p>I got a problem about the Force Close. I just wanna how will this problem will be solved? </p>

<p><strong>Here's the LOGCAT:</strong> </p>

<p><code>03-25 02:57:38.883: W/KeyCharacterMap(294): No keyboard for id 0
03-25 02:57:38.893: W/KeyCharacterMap(294): Using default keymap:   /system/usr/keychars/qwerty.kcm.bin
03-25 02:57:41.853: D/AndroidRuntime(294): Shutting down VM
03-25 02:57:41.853: W/dalvikvm(294): threadid=1: thread exiting with uncaught exception (group=0x4001d800)</code></p>

<p><code>03-25 02:57:41.903: E/AndroidRuntime(294): FATAL EXCEPTION: main
03-25 02:57:41.903: E/AndroidRuntime(294): android.content.ActivityNotFoundException: Unable to find explicit activity class {me.mojica.caloriewatch/android.view.Menu}; have you declared this activity in your AndroidManifest.xml?
03-25 02:57:41.903: E/AndroidRuntime(294):  at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
03-25 02:57:41.903: E/AndroidRuntime(294): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)</code></p>

<p><code>03-25 02:57:41.903: E/AndroidRuntime(294):at android.app.Activity.startActivityForResult(Activity.java:2817)
03-25 02:57:41.903: E/AndroidRuntime(294):at me.mojica.caloriewatch.Startup$1.onClick(Startup.java:29)
03-25 02:57:41.903: E/AndroidRuntime(294):  at android.view.View.performClick(View.java:2408)
03-25 02:57:41.903: E/AndroidRuntime(294):  at android.view.View$PerformClick.run(View.java:8816)</code></p>

<p><code>03-25 02:57:41.903: E/AndroidRuntime(294):     at android.os.Handler.handleCallback(Handler.java:587)
03-25 02:57:41.903: E/AndroidRuntime(294):  at android.os.Handler.dispatchMessage(Handler.java:92)
03-25 02:57:41.903: E/AndroidRuntime(294):  at android.os.Looper.loop(Looper.java:123)
03-25 02:57:41.903: E/AndroidRuntime(294):  at android.app.ActivityThread.main(ActivityThread.java:4627)</code></p>

<p><code>03-25 02:57:41.903: E/AndroidRuntime(294):     at java.lang.reflect.Method.invokeNative(Native Method)
03-25 02:57:41.903: E/AndroidRuntime(294):  at java.lang.reflect.Method.invoke(Method.java:521)
03-25 02:57:41.903: E/AndroidRuntime(294):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-25 02:57:41.903: E/AndroidRuntime(294):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)</code></p>

<p><code>03-25 02:57:41.903: E/AndroidRuntime(294):     at dalvik.system.NativeStart.main(Native Method)
03-25 02:57:57.033: I/Process(294): Sending signal. PID: 294 SIG: 9
03-25 03:00:35.673: D/AndroidRuntime(324): Shutting down VM
03-25 03:00:35.673: W/dalvikvm(324): threadid=1: thread exiting with uncaught exception (group=0x4001d800)</code></p>

<p><code>03-25 03:00:35.743: E/AndroidRuntime(324): FATAL EXCEPTION: main
03-25 03:00:35.743: E/AndroidRuntime(324): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{me.mojica.caloriewatch/me.mojica.caloriewatch.Startup}: java.lang.NullPointerException
03-25 03:00:35.743: E/AndroidRuntime(324):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
03-25 03:00:35.743: E/AndroidRuntime(324):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)</code></p>

<p><code>03-25 03:00:35.743: E/AndroidRuntime(324):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-25 03:00:35.743: E/AndroidRuntime(324):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-25 03:00:35.743: E/AndroidRuntime(324):  at android.os.Handler.dispatchMessage(Handler.java:99)
03-25 03:00:35.743: E/AndroidRuntime(324):  at android.os.Looper.loop(Looper.java:123)</code></p>

<p><code>03-25 03:00:35.743: E/AndroidRuntime(324):     at android.app.ActivityThread.main(ActivityThread.java:4627)
03-25 03:00:35.743: E/AndroidRuntime(324):  at java.lang.reflect.Method.invokeNative(Native Method)
03-25 03:00:35.743: E/AndroidRuntime(324):  at java.lang.reflect.Method.invoke(Method.java:521)
03-25 03:00:35.743: E/AndroidRuntime(324):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)</code></p>

<p><code>03-25 03:00:35.743: E/AndroidRuntime(324):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-25 03:00:35.743: E/AndroidRuntime(324):  at dalvik.system.NativeStart.main(Native Method)
03-25 03:00:35.743: E/AndroidRuntime(324): Caused by: java.lang.NullPointerException
03-25 03:00:35.743: E/AndroidRuntime(324):  at android.app.Activity.findViewById(Activity.java:1637)</code></p>

<p><code>03-25 03:00:35.743: E/AndroidRuntime(324):     at me.mojica.caloriewatch.Startup.&lt;init&gt;(Startup.java:40)
03-25 03:00:35.743: E/AndroidRuntime(324):  at java.lang.Class.newInstanceImpl(Native Method)
03-25 03:00:35.743: E/AndroidRuntime(324):  at java.lang.Class.newInstance(Class.java:1429)
03-25 03:00:35.743: E/AndroidRuntime(324):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)</code></p>

<p><code>03-25 03:00:35.743: E/AndroidRuntime(324):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
03-25 03:00:35.743: E/AndroidRuntime(324):  ... 11 more
03-25 03:01:00.653: I/Process(324): Sending signal. PID: 324 SIG: 9
03-25 03:03:21.723: W/KeyCharacterMap(353): No keyboard for id 0</code></p>

<p><code>03-25 03:03:21.723: W/KeyCharacterMap(353): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
03-25 03:05:21.883: D/AndroidRuntime(381): Shutting down VM
03-25 03:05:21.883: W/dalvikvm(381): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
03-25 03:05:21.933: E/AndroidRuntime(381): FATAL EXCEPTION: main</code></p>

<p><code>03-25 03:05:21.933: E/AndroidRuntime(381): android.content.ActivityNotFoundException: Unable to find explicit activity class {me.mojica.caloriewatch/android.view.Menu}; have you declared this activity in your AndroidManifest.xml?
03-25 03:05:21.933: E/AndroidRuntime(381):  at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
03-25 03:05:21.933: E/AndroidRuntime(381):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
03-25 03:05:21.933: E/AndroidRuntime(381):  at android.app.Activity.startActivityForResult(Activity.java:2817)</code></p>

<p><code>03-25 03:05:21.933: E/AndroidRuntime(381):     at android.app.Activity.startActivity(Activity.java:2923)
03-25 03:05:21.933: E/AndroidRuntime(381):  at me.mojica.caloriewatch.Welcome$1.onClick(Welcome.java:31)
03-25 03:05:21.933: E/AndroidRuntime(381):  at android.view.View.performClick(View.java:2408)
03-25 03:05:21.933: E/AndroidRuntime(381):  at android.view.View$PerformClick.run(View.java:8816)</code></p>

<p><code>03-25 03:05:21.933: E/AndroidRuntime(381):     at android.os.Handler.handleCallback(Handler.java:587)
03-25 03:05:21.933: E/AndroidRuntime(381):  at android.os.Handler.dispatchMessage(Handler.java:92)
03-25 03:05:21.933: E/AndroidRuntime(381):  at android.os.Looper.loop(Looper.java:123)
03-25 03:05:21.933: E/AndroidRuntime(381):  at android.app.ActivityThread.main(ActivityThread.java:4627)</code></p>

<p><code>03-25 03:05:21.933: E/AndroidRuntime(381):     at java.lang.reflect.Method.invokeNative(Native Method)
03-25 03:05:21.933: E/AndroidRuntime(381):  at java.lang.reflect.Method.invoke(Method.java:521)
03-25 03:05:21.933: E/AndroidRuntime(381):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-25 03:05:21.933: E/AndroidRuntime(381):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)</code></p>

<p><code>03-25 03:05:21.933: E/AndroidRuntime(381):     at dalvik.system.NativeStart.main(Native Method)
03-25 03:05:24.503: I/Process(381): Sending signal. PID: 381 SIG: 9</code></p>

<p><code>**Welcome.java**
package me.mojica.caloriewatch;
import android.os.Bundle;
import android.content.Intent;</code></p>

<p><code>import android.content.pm.ActivityInfo;</code>
import android.app.Activity;
import android.view.Menu;
import android.view.MenuInflater;`</p>

<p><code>import android.view.MenuItem;</code>
<code>import android.view.View;</code>
<code>import android.widget.Button;</code>
`public class Welcome extends Activity {</p>

<p><code>Button menu, adddb;
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);</code></p>

<pre><code>   ` setContentView(R.layout.welcome);
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);     
    menu = (Button) findViewById(R.id.bCont);
    menu.setOnClickListener(new View.OnClickListener() {`

        `@Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            Intent intent = new Intent(Welcome.this, Menu.class);`

            startActivityForResult(intent, 0);
        }
    });
    adddb = (Button) findViewById(R.id.imadd);`

    `adddb.setOnClickListener(new View.OnClickListener(){
        public void onClick(View v){
        Intent intent = new Intent(Welcome.this, Add.class); startActivity(intent);`

        `}
    });
</code></pre>

<p>}`</p>

<p><code>public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.welcome, menu);
    return true;
}</code></p>

<p><code>public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.about:
    startActivity(new Intent(this, About.class));
    return true;</code>
<code>default:
 return super.onOptionsItemSelected(item);</code>
   <code>}
}
}</code></p>
