as the title states, im trying to update something in my UI thread while running an asynctask.. i've read quite a bit on asynctask and it seems i should be able to change a variable from the onPostExecute() method. obviously this is not the case.
Here is my sample code:
TextView tv = (TextView) findViewById(R.id.thingsThatNeedToBeUpdated);
Login login = new Login();
login.execute(userName, password);
and here the the login class
public class Login extends AsyncTask<String, void, String>{
public String doInBackground(String... params){
logMeIn(params[0], params[1]);
}
public void onPostExecute(String update){
tv.setText(result); //this is not working!!
}
whats actually happening is tv is underlined red and eclipse says i need to create a local variable.. but i thought the onPostExecute is ran from the UI thread? confused :?
im trying to do what i found at this website. I'm not entirly sure what i'm doing and i would love a point in the right direction! thanks in advance.