I've got an Android (News) Widget with a list of Elements and a Header.
Within this header, I've got a refresh button. If the user clicks the button the list gets updated.
The widget works fine. Refresh works and everything seems to be OK.
However, I've got one problem: If the user clicks on the refresh button multiple times the request gets sent multiple times as well. And that even while loading is still in progress.
I need to prevent any re-load while it is still loading. The problem seems that preventing within the onReceive method is too late.
Is there any possibility to hide/disable/... the refresh button while the app is still loading -> Important: Before sending the broadcast intent.
This is my code:
views.setOnClickPendingIntent(
R.id.image_reload,
context.pendingBrodcastIntent<NewstickerListAppWidgetProvider>(
appWidgetId,
NewstickerListAppWidgetProvider.ACTION_UPDATE_LIST
)
)
I can hear the click sound if I click the refresh button.
I know it is possible because there is a different app, where it works as I would like it to work:
With the "DER SPIEGEL," you can hear the click sound only while the app is not refreshing. This means they block the sending broadcast pending intent with some mechanism: They are able to hide the refresh button after clicking it once, so a double tap is prevented.
