3
I am developing an application that in the main screen will have some buttons, and these buttons access a URL sending commands on and off all this through Httpclient and persisting all this information.
I have the following scenario:
- I have 3 buttons all with status off.
- User 1 with your mobile click on the button 3 that accesses the server and persists this information to
- The Mobile User 2 must from time to time know the status of these buttons
- Both Users can use the on and off buttons feature.
How to make Activity from time to time perform this update, I tried to do the example below but succeeded.
I stand by.
Handler handler = new Handler();
private void doTheAutoRefresh()
{
handler.postDelayed(new Runnable() {
@Override
public void run()
{
// Write code for your refresh logic
doTheAutoRefresh();
}
}, 5000);
}
Jorge Carlos Guedert with the Handler Solution is satisfactory, and I already see as solved this post, and through the solution I implanted Handler, I am using beyond the expected perfect, and the best without flaws, and most importantly the system is working without overloading the mobile device.
– Cyberlacs