Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java Android. Here is what I'm wrote and my app crashing when I try to settext:

C#
private class DownloadFilesTask extends AsyncTask<String, Integer, Long> {
    protected Long doInBackground(String... urls) {
        ConnectViaLoginAndPass();
        long i = 10;
        return i;
    }
}
public void ConnectViaLoginAndPass(){
//here I want to textBox.setText("some text for debug");
}


Call by this:
Java
new DownloadFilesTask().execute("unneededurl");

Please, help.
Posted
Updated 10-Nov-12 7:04am
v2
Comments
TorstenH. 10-Nov-12 19:33pm    
What is the exception?
Might be an invalid Thread access: You might be trying to set the text from another thread. You need to use the display's thread.
DalliaF 8-Mar-13 20:30pm    
this is much better--->click http://stackoverflow.com/questions/6057187/how-to-update-ui-using-asynctask

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900