Android - update widget text -


I have 2 questions about widget updates

  • I have 2 buttons and I need to change a button text when I press another, how can I do this?
  • The first time I open the widget, it calls the update method, but it is never called again. I need to update the widget every 2 seconds and I have this line in xml.

    Android: updatePeriodMillis = "2000"

Do I need a service or can it only work with the updated Periodism tag?

  • Ongoing Method

      Remote Visual View = New Remote Power (context.getPackageName (), R.Lay Out.NetsWidget); Intent to intent = new intent (context, detetal consultation class); Intent.putExtra (DetalleConsulta.CONSULTA_ID_NAME, "3"); Pending pending vertical positioning = pending.activity (reference, 0, intent, 0); Views.setOnClickPendingIntent (R.id.btNews, Pending Pending); / * EnasiLizze variable para lalamar el-controller * / this.imei = ((telephony manager) context.getSystemService (context.TELEPHONY_SERVICE)). GetDeviceId (); This.controlador = New Controller (this.imei); {Try this.respuestas = this.controlador.recuperarNuevasRespuestas (); If (this.respuestas! = Null & amp; amp; this.respuestas.size ()> 0) {Eitator & lt; Concerta & gt; Itersarpusstas = This.prostestitator (); Views.setTextViewText (R.id.btNews, (Consultate) Iter Rests.net ()). GetRespuesta ()); }} Hold (PersistenciaException e) {// TODO Manejar Error} appWidgetManager.updateAppWidget (Episode Edge, view);  

thx lot !!!

  • About the first question I found a great example of handling widget events:

  • I was reading about the other web and I came to know that the minimum 1.6 minutes to update the widget in Android 1.6 is 30 minutes.

I tried to do it and it works.

I hope it helps other people !!!


Comments