I have an android app where i have some set of text views which are required to change in real time. So please suggest me how to update the text view frequently.
Here is my code:-
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
final Handler handler = new Handler();
Thread thread =new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
handler.post(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
Dt_textView.setText(//getting the value from a class object);
As_textView.setText("getting the value from a class object");
}
});
}
});
thread.start();
}
This works but once the value gets change in the back end it doesn't get reflected immediately, until the resume function gets called again.
please give me a solution to resolve this, Its very important for me.