Android & Netbeans: "Stopped unexpectedly"
<p>I'm new to Android, but OK with Java, and prefer Netbeans to Eclipse. I'm trying to get the HelloAndroid app running, without success.</p>

<pre><code>package com.ex.helloandroid;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
   TextView tv = new TextView(this);
   tv.setText("Hello, Android");
   setContentView(tv);
}
}
</code></pre>

<p>Manifest:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.ex.helloandroid"
  android:versionCode="1"
  android:versionName="1.0"&gt;
&lt;application android:label="@string/app_name" &gt;
    &lt;activity android:name="HelloAndroid"
              android:label="@string/app_name"&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;/application&gt;
&lt;/manifest&gt; 
</code></pre>

<p>This compiles OK, and installs OK in both the emulator and my phone. But when I try to run it, I get the dreaded "The application HelloAndroid (process com.ex.helloandroid) has stopped unexpectedly. Please try again."</p>

<p>Here's the logcat:</p>

<pre><code>I/ActivityManager(   70): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.ex.helloandroid/.HelloAndroid }
I/ActivityManager(   70): Start proc com.ex.helloandroid for activity com.ex.helloandroid/.HelloAndroid: pid=691 uid=10036 gids={1015}
D/AndroidRuntime(  691): Shutting down VM
W/dalvikvm(  691): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
E/AndroidRuntime(  691): FATAL EXCEPTION: main
E/AndroidRuntime(  691): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ex.helloandroid/com.ex.helloandroid.HelloAndroid}: java.lang.ClassNotFoundException: com.ex.helloandroid.HelloAndroid in loader dalvik.system.PathClassLoader[/dat
a/app/com.ex.helloandroid-1.apk]
E/AndroidRuntime(  691):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
E/AndroidRuntime(  691):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime(  691):        at android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime(  691):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime(  691):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  691):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  691):        at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(  691):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  691):        at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  691):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime(  691):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime(  691):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(  691): Caused by: java.lang.ClassNotFoundException: com.ex.helloandroid.HelloAndroid in loader dalvik.system.PathC
lassLoader[/data/app/com.ex.helloandroid-1.apk]
E/AndroidRuntime(  691):        at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
E/AndroidRuntime(  691):        at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
E/AndroidRuntime(  691):        at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
E/AndroidRuntime(  691):        at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime(  691):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
E/AndroidRuntime(  691):        ... 11 more
W/ActivityManager(   70):   Force finishing activity com.ex.helloandroid/.HelloAndroid
W/ActivityManager(   70): Activity pause timeout for HistoryRecord{45422d20 com.ex.helloandroid/.HelloAndroid}
W/ActivityManager(   70): Activity destroy timeout for HistoryRecord{45422d20 com.ex.helloandroid/.HelloAndroid}
I/Process (  691): Sending signal. PID: 691 SIG: 9
I/ActivityManager(   70): Process com.ex.helloandroid (pid 691) has died.
W/InputManagerService(   70): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Prox
y@451f4560
</code></pre>

<p>I've spent days trying to make this work... installed a new copy of Netbeans, reinstalled NBAndroid, reinstalled Android SDK, Googled and fiddled with the code. Can someone please help?</p>

<p>Thanks</p>

<p>Frank</p>
