I have a widget that gets updated when I press it, but I would like to show a progress wheel while the widget gets updated.
//remove text
updateViews.setViewVisibility(R.id.widget_textview, View.GONE);
updateViews.setViewVisibility(R.id.widget_dkk, View.GONE);
// show progress wheel
updateViews.setViewVisibility(R.id.widget_Pross, View.VISIBLE);
// task that take time are locatet here a GetHTTP function
//Show text again
updateViews.setViewVisibility(R.id.widget_textview, View.VISIBLE);
updateViews.setViewVisibility(R.id.widget_dkk, View.VISIBLE);
// Remove progress wheel
updateViews.setViewVisibility(R.id.widget_Pross, View.GONE);
ALL this are locatet this in my widget update class:
public static RemoteViews buildUpdate(Context context) {
But the progress wheel does not show. It's like the widget only get updated one time, and thereby not showing the progress wheel while computing in the GetHttp.
EDIT:
// Remove rext and show progress wheel
updateViews.setViewVisibility(R.id.widget_textview, View.GONE);
updateViews.setViewVisibility(R.id.widget_dkk, View.GONE);
updateViews.setViewVisibility(R.id.widget_Pross, View.VISIBLE);
ComponentName thisWidget = new ComponentName(context, SaldoWidget.class);
AppWidgetManager manager = AppWidgetManager.getInstance(context);
manager.updateAppWidget(thisWidget, updateViews);
// GetHttp code here / long computing task her
//Show text and remove progress wheel
updateViews.setViewVisibility(R.id.widget_textview, View.VISIBLE);
updateViews.setViewVisibility(R.id.widget_dkk, View.VISIBLE);
updateViews.setViewVisibility(R.id.widget_Pross, View.GONE);
manager.updateAppWidget(thisWidget, updateViews);