简体   繁体   中英

Implement button as widget

I want to implement button as a widget. The button has a primary function in app. On clicking the button in app it redirect to another fragment and play a sound. Is there any way to do so from widget ie, making the button work same function ?

From what i understand, you mean the launcher widget that sits on the app tray/menu? If so, just create an activity with that functionality and set it as the launcher activity. Thats the activity that will launch when the widget is tapped.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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