3

I have a program that posts tweets on the user's behalf. Everything works in the AVD. However, I cannot seem to allow my program to have an icon. The strange thing is when I remove the lines for the BROWSABLE category and the data tag, the icon shows up and the program shows up in the program list as normal.

I think there is a problem with my Android Manifest, but I can't seem to get everything working. Please help!

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:theme="@style/Theme.AppCompat.Light"
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:launchMode="singleTask" >
        <intent-filter>
            <category android:name="android.intent.category.BROWSABLE"/>
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="android.intent.category.TAB"/>
            <action android:name="android.intent.action.MAIN" />
            <action android:name="android.intent.action.VIEW"/>
            <data android:scheme="howsmydriving-oauth-twitter" android:host="callback"/>
        </intent-filter>
    </activity>

    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
    <activity android:name="com.google.android.gms.ads.AdActivity"
         android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
Namingwaysway
  • 270
  • 1
  • 17

2 Answers2

7

Alright, so, I figured out my problem.

I need two intent-filters for this. Changing the intent filter portion to the following allowed me to both view my app in the installed app listing and get the OAuth redirect:

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

         <intent-filter>
         <action android:name="android.intent.action.VIEW" />
         <category android:name="android.intent.category.DEFAULT" />
         <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="howsmydriving-oauth-twitter" android:host="callback"/>
         </intent-filter>
Namingwaysway
  • 270
  • 1
  • 17
1

You are missing the android:icon entry. It should be equal to a string @drawable/$NAME, i.e. android:icon="@drawable/ic_launcher" This might help.

Community
  • 1
  • 1
emerssso
  • 2,376
  • 18
  • 24
  • I actually have that, I just neglected to include it. But the default icon does indeed show up when the program is correctly installed. – Namingwaysway Mar 07 '14 at 01:57