Aruna
Aruna

Reputation: 2052

Add widget name to the home screen along with widget

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.

Upvotes: 4

Views: 3214

Answers (3)

forcewill
forcewill

Reputation: 1647

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

Upvotes: 2

Hamad
Hamad

Reputation: 5152

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

Upvotes: 2

elichai2
elichai2

Reputation: 1405

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

Upvotes: 3

Related Questions