Reputation: 21
I'm new to Android development, and I am trying to get familiar with it with some tutorials from developer.android.com. I'm working on the TabLayout
example, and I'm doing everything in the example. However, when I run it through the emulator, the program loads but when I try to start the application it says that was happened a problem and attends me to force down! Because I followed the tutorial step by step, I believe that I have made a mistake in the AndroidManifest file. Here is what I wrote:
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloTabWidget" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<activity android:name=".ArtistsActivity" android:label="@string/app_name" > </activity>
<activity android:name=".AlbumsActivity" android:label="@string/app_name" > </activity>
<activity android:name=".SongsActivity" android:label="@string/app_name" > </activity>
</activity>
can anybody help me to run this??its very important for me to learn as i m a computer eng university student and my thesis will be an application for android!!thanks a lot for your time!!
Upvotes: 2
Views: 8187
Reputation: 2966
You have declared your other activities inside your main activity block - make sure you close the first activity before declaring the others. See my additions below:
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloTabWidget" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> <!-- ADD THIS CLOSE TAG -->
<activity android:name=".ArtistsActivity" android:label="@string/app_name></activity>
<activity android:name=".AlbumsActivity" android:label="@string/app_name"></activity>
<activity android:name=".SongsActivity" android:label="@string/app_name"></activity>
</application> <!-- PLUS, close your application tag -->
Upvotes: 2
Reputation: 286
you can see some useful information and locate the problem looking at the logcat view in eclipse (and in adb logcat). Can you post the exception that occurs when you try to launch your program ?
Upvotes: 0