Hi All,
I have created a service that starts a thread to increment COUNTER value.
The COUNTER value is passed to an activity from service using either of
Handler or aidl. COUNTER value has been received in Activity and it is
updated continuously within Activity TextView field.
In Activity TextView value incremented like 1->2->3->4->5->6->7 ... so on
upto infinite.

Issue is :
While updating TextView field value(received from service ). It is
sometimes decrement value and displayed in TextView field and then resume
back from updated COUNTER value.
Such as: 1->2->*3->4->3*->6->7  ... so on upto infinite.

Note here, after 4 , 5 has to come. But, it has displayed 3. And then
resumed back from incremented value 6. I have printed logs before and after
fetching of updated COUNTER value from service.

Refer below Code snippet:
System.out.println("Counter="+COUNTER);  // prints 4
COUNTER=service.getCounterValue();
System.out.println("Counter="+COUNTER);  // prints 5
textView.setText("Counter="+COUNTER);    // *prints 3*
and then prints 6->7 ...so on.

As per logs, it has fetched correct value but displayed incorrect value in
TextView.

So, please let me know how to solve this problem.

Thanks & regards,
Deepak Kumar

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CALR0e8W2Z7Uj6MEAwB%3D7r8XbjgmhdpYysmM39A7gAyW40NW2UA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to