简体   繁体   English

如何在app抽屉中显示app小部件

[英]How to show app widget in app drawer

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. 我想要这样的东西。

看看facebook的标志

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. 不要求任何主屏幕提供此功能,并且没有关于如何告诉主屏幕您想要此行为的标准。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM