I'm developing an application that on the main screen will have a few buttons, and these buttons access a URL sending commands on and off all through HttpClient and persisting all this information.
I have the following scenario:
- I have 3 buttons all with status off.
- User 1 with your cell phone clicks the button 3 that accesses the server and this information persists for connected
- Mobile User 2 should from time to time know the status of these buttons
- Both Users will be able to use the on and off buttons.
How to do the activity from time to time to perform this update, I tried to do the example below but I succeeded.
I'm waiting for you.
Handler handler = new Handler();
private void doTheAutoRefresh()
{
handler.postDelayed(new Runnable() {
@Override
public void run()
{
// Write code for your refresh logic
doTheAutoRefresh();
}
}, 5000);
}