SORU
11 AĞUSTOS 2010, ÇARŞAMBA


Program aracılığıyla faaliyet/hizmet/güncelleme widget alıcısı

Mümkün olduğunu biliyorum, ama ana etkinlikten benim widget bir güncelleştirme tetiklemek için bir yol bulamıyorum. Orada yayın yapabileceğim bir genel niyet değil mi?

CEVAP
10 Aralık 2010, Cuma


Bu konuda aradığımda yardımcı oldunasıl servis/veya bir eylemden bir widget güncellemek için(ama İçerik her) mümkün olabilir:

Context context = this;
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_2x1);
ComponentName thisWidget = new ComponentName(context, MyWidget.class);
remoteViews.setTextViewText(R.id.my_text_view, "myText"   System.currentTimeMillis());
appWidgetManager.updateAppWidget(thisWidget, remoteViews);

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • RocketJump

    RocketJump

    22 ŞUBAT 2006
  • UKF Dubstep

    UKF Dubstep

    29 NİSAN 2009
  • VJ VIMANA

    VJ VIMANA

    3 Mayıs 2007