Error starting tab activity in Android?

I followed the instructions in this Android tutorial copying / pasting the code from the site into my application.

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

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

"The Hello Tab application widget stopped unexpectedly. Please try again."

I tried debugging by entering a breakpoint on the first line of the onCreate method, but the error occurs before the breakpoint even hits. Any idea of ​​what is going wrong, or in some other way I can debug this problem? I am using Eclipse.

+2


a source to share


3 answers


Since your symptoms are very general, you should try to view all the logs generated by your application. You can do this by typing:

adb logcat



Here you can determine the exact point at which your application crashes. Briefly, you will see an Exception being thrown, which can give you an idea of ​​what is going on. You can edit your post and add journal information as well as the code you wrote so that we can help you.

0


a source


you probably came across class names and your AndroidManifest.xml no longer points to the main action.

Make sure that:

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

      



is inside the tags <activity>

in the AndroidManifest.xml file.

You can also configure this with the manifest GUI in eclipse if you like.

0


a source


This could be due to a mismatch in the activity name in the manifest.

So, check if the action names you specified in the code and in the manifest are the same.

0


a source







All Articles