I have a Android application where its Main activity constantly download and parse a XML from the internet using AsyncTask
and update the value to UI using onPostExecute();
However,
there is a EditText which can edit value and update to XML using a button as well.
but I couldn't input any value on the EditText as the it is updated by onPostExecute();
every 3 second.
(by the time i finish input my value, it is wash out by the updated value from XML)
I have implement onClickListener();
and tried onPause();
but did not work.
How should I pause the UI update/application?
EDIT #1
Protected Void onCreate(...){
......
listener();
runnablecode.run();
}
public void run(){
AsyncDownloader downloadxml = new AsyncDownloader();
downloadxml.execute();
handler.postDelay(runnablCode,poll_interval);
}
private void listener();{
EditText atten = (EditText)findViewById(R.id.attenEditText);
atten.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View v, MotionEvent event){
//I want to pause UI updating the EditText here
return false;
}
});
}