4

I have created a widget for an application. And widget is displaying along with the name under widget tab. When I drag the widget onto the home screen, the name below the widget is missing.

I have already set the label property for the <receiver></receiver>.

Is there anything else I need to do or any other configuration to change?

Regards.

Aruna
  • 1,962
  • 4
  • 25
  • 50

3 Answers3

2

You can set the name of your app widget to be displayed in the widget picker by adding android:label="the name of my appwidget" to the receiver that handles appwidget related intents in AndroidManifest.xml. It is documented in a somewhat obscure place: http://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo.html#label

How do I give a Android App Widget a Label/Name

elichai2
  • 1,365
  • 3
  • 14
  • 28
  • Or try this either: https://stackoverflow.com/questions/2651631/android-home-screen-widget-icon-label-style/2652961#2652961 – elichai2 Oct 12 '14 at 09:36
  • No this does not solve my problem. As I mentioned I could see the name in the widget picket but when I put my 1x1 widget on the home screen I don't see any name under it. For example: Put a Direct Dial widget and associate it with a contact. You will see name of that contact under direct dial widget but in my case I don't see any name\label under 1x1 widget. – user531069 Oct 13 '14 at 16:52
  • http://stackoverflow.com/questions/25334555/is-it-possible-to-get-the-shortcut-layout-of-launcher-and-use-it-in-our-own-widg/25439010#25439010 – Kevin TeslaCoil Oct 14 '14 at 02:20
2

Sorry to say that, it is not possible, because widgets name will be shown in only widgets menu not on home screen in many launchers, But you can use Shortcuts.

Shortcuts show the name with icon, they are simple, all data (icon, label, intent) is static, determined at creation time. They can't be updated dynamically, or resized, or scroll. But they match the launcher styling (and can be placed inside folders or the dock) and use less resources than AppWidgets.

As @kevin TeslaColl suggested, you should use Shortcuts

Community
  • 1
  • 1
Hamad
  • 5,096
  • 13
  • 37
  • 65
  • Got it, I accepted the answer and given bounty points as well. Can I also provide custom layout to the shortcut just like in case of 1x1 or any size widget? – user531069 Oct 14 '14 at 19:24
2

If you want a label to appear bellow the widget when its placed on the home screen, just place a TextView on your widget xml layout with the label you want

forcewill
  • 1,637
  • 2
  • 16
  • 31