david
david

Reputation: 2142

Android - update widget text

i have 2 questions about widgets update

Do i need a service or should it works just with the updatePeriodMillis tag?

thx a lot!!!

Upvotes: 1

Views: 8518

Answers (2)

Jorgesys
Jorgesys

Reputation: 126465

yes that changed since donut(1.6) to avoid your battery will be consumed shortly.

Hey David the next time try to put your other question in different thread to be accord with stackoverflow.com =)

to update the text from another button...

 final    Button btn1 = (Button) this.findViewById(R.id.Button01);
   final Button btn2 = (Button) this.findViewById(R.id.Button02);

   btn1.setOnClickListener(new OnClickListener() {                      
            @Override
            public void onClick(View v) {
                btn2.setText("Button1 changed your text!");
            }           
        });      

Upvotes: 0

david
david

Reputation: 2142

  • about the first question i found a great example about handle widget events:

Handling User Interaction with Android App Widgets

  • about the second one i was reading on the web and i found that in android 1.6 the minimun time to update the widget is 30 min.

I tried it and it works.

i hope this help others!!!

Upvotes: 1

Related Questions