-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add click button on widget #6
Comments
Currently there is no support for communication from HomeScreenWidgets back to the App. But it is on my list! |
Okay I got it. |
@ABausG When we expect the click from widget to app? |
Same issue for me. I don't know how to implement a button-click event. |
I'm working on adding this functionality. If everything works it will come in two stages
Unfortunately I can't give an estimate on when this will land but it is the feature that is on top of my list. |
I've implemented a button-click event by overriding the
companion object {
private const val BUTTON_CLICK_ACTION= "StartSleepButtonClicked"
}
...
val pendingButtonClickIntent: PendingIntent = Intent(context, HomeWidgetExampleProvider::class.java).let {
it.action = BUTTON_CLICK_ACTION
it.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widgetId)
return@let PendingIntent.getBroadcast(context, widgetId, it, PendingIntent.FLAG_UPDATE_CURRENT)
}
setOnClickPendingIntent(R.id.button, pendingButtonClickIntent)
...
override fun onReceive(context: Context?, intent: Intent) {
super.onReceive(context, intent)
if (intent.action == BUTTON_CLICK_ACTION) {
}
} |
Version |
Hello,
I applied this library success,
I add more feature when using this.
I did not found any document details the method like
setOnClickListener()
(orsetTextViewText()
) to apply (EvenCtril+Space
does not help me also)So how I implemented a clicked button success?
Please help me indicate that?
Code lines :
The text was updated successfully, but these errors were encountered: