Search code examples
androidandroid-widgetandroid-contextmenuandroid-appshortcut

Android widget "Widget settings" shortcut on long press


I want my widget to have a "configure widget" option along the default "app info" and "remove from home" I get when creating a widget. Ive being looking into the android documentations for a few hours and I cant find if there's a standard way of doing this. I'm not sure if there's a standard android approach of adding menu items to this context menu or if its only something specific to the installed launcher but on my Samsung device, the pre-installed clock widget has this exact feature as shown here: enter image description here

I tried adding an app shortcut (but it is obviously not the case since a widget does not have a "LAUNCHER" activity)

I tried adding an option menu

I tried adding different actions to my configuration activity.

any guidance or direction to the correct documentation would be appreciated.


Solution

  • I found the solution. it is specifically to add a "widget settings" feature to the context menu.

    under your provider info xml, simply add:

    android:widgetFeatures="reconfigurable"