1

In app drawer I wanted to show my app widget instead of launcher icon. This solution doesn't work for me.

This is my launcher activity entry in manifest file

<activity
        android:name=".SplashActivity"
        android:screenOrientation="portrait"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar"
        android:windowSoftInputMode="stateAlwaysHidden">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
            <action android:name="com.abc.xyz.providers.WidgetProvider.ACTION_WIDGET_RECEIVER" />
        </intent-filter>
    </activity>

This is my receiver

<receiver android:name=".providers.WidgetProvider">
        <intent-filter>
            <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            <action android:name="com.abc.xyz.providers.WidgetProvider.ACTION_WIDGET_RECEIVER" />
        </intent-filter>
        <meta-data
            android:name="android.appwidget.provider"
            android:resource="@xml/tt_appwidget_provider" />
    </receiver>

Please help me!

Thanks in advance!

I want something like this.

look at facebook logo

Community
  • 1
  • 1

1 Answers1

0

In app drawer I wanted to show my app widget instead of launcher icon

You are welcome to implement your own home screen, with your own launcher/app drawer, that has this feature. There is no requirement that any home screen offer this feature, and there are no standards for how you would tell a home screen that you wanted this behavior.

CommonsWare
  • 910,778
  • 176
  • 2,215
  • 2,253
  • I wanna show it on default home screen with default launcher/app drawer. Facebook icon above is showing in default as well as custom launcher/app drawer also. As per my knowledge it should not bother about custom or default launcher/app drawer. Please check link in my question – Rohit Chaskar May 31 '16 at 13:44
  • @RohitChaskar: "Facebook icon above is showing in default as well as custom launcher/app drawer also" -- then that is not an app widget. – CommonsWare May 31 '16 at 13:47
  • Then what is it? no of posts on it changes dynamically. I wanna create something like this. – Rohit Chaskar May 31 '16 at 13:49
  • @RohitChaskar: It is a badge on a launcher icon. There is no official support for this that works across devices, because there is no requirement for a home screen to support it. There are various recipes for enabling support on the handful of home screens that offer badges. You can also attempt to "fake it" via a whole lot of `` entries in your manifest, each pointing to a different launcher icon that has the badge pre-applied, then enabling/disabling components to activate the right alias with the right badge. This too is unreliable. – CommonsWare May 31 '16 at 13:52