views:

44

answers:

2

I followed the directions verbatim in this Android tutorial, copying/pasting the code from the site to my app.

http://developer.android.com/resources/tutorials/views/hello-tabwidget.html

However, when I try to run in the Android emulator, I get the error:

"The application Hello Tab Widget has stopped unexpectedly. Please try again."

I tried debugging by introducing a breakpoint in the first line of the onCreate method, but the error occurs before the breakpoint is even hit. Any idea of what is going wrong, or any other way I can debug this issue? I am using Eclipse.

A: 

As your symptoms are very generic, you should try to see all the logs that are generated by your application. You can do so by typing:

adb logcat

There, you can identify the exact point where your application is crashing. Ususally you will see that a Exception is thrown which can give you an idea of what's going on. You can edit your post and put revelant information of the log, as well as some code you have written so that we can help you easly.

Cristian
A: 

you likely were messing around with class names and your AndroidManifest.xml no longer indicates the main activity.

make sure:

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

is inside the <activity> tags in AndroidManifest.xml file.

You can also configure this via the manifest GUI in eclipse if you want.

Mark