Search code examples
androidandroid-intentandroid-manifestandroid-tabhostandroid-install-apk

Following android tab tutorial, can't find or launch installed app on device or emulator


Attempting to follow this project http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/

When I run it, it says everything installs alright but nothing comes up and it's not listed under apps. I find it under application manager.. What can cause an app to install and not launch?

edit: Here's my manifest.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.tabs"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="17" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

        <activity android:name="TabsFragmentActivity" >
        </activity>
    </application>

</manifest>

Solution

  • Have you got a launcher Activity?

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

    Edit: You did not surround it with an Activity tag, so basically you don't have a launcher Activity, fix it like this:

     [...]
    <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name" >
            <activity android:name="TabsFragmentActivity" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
     [...]