My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 90: Set label bug on textfield.
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Jan 2011


 
Reported by richard....@googlemail.com, Jan 5, 2011
What steps will reproduce the problem?
1.Attempting to set the label on textfield from a running thread. other than through posting it.
2. Any 
3.

What is the expected output? What do you see instead?
output should be a change in the label of the textfield. Error is thrown.
V/MicroEmulator(  188): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
V/MicroEmulator(  188): 	  
V/MicroEmulator(  188): sin item state changed
V/MicroEmulator(  188): 	  
V/MicroEmulator(  188): .	at android.view.ViewRoot.checkThread(ViewRoot.java:2682)


What version of the product are you using? On what operating system?
Version 3, on linux

Please provide any additional information below.
The problem should be solved by the method listed below.

public void setLabel(String label) {
		labelView.setText(label);
	}
Should resembly the method below, then it is handled by android, it is definately a design floor, cause it is a mess to have to do things like this. But android is a mess in general.

public void setString(final String text) {
		activity.post(new Runnable() {
			public void run() {
				editView.setText(text);
			}
		});
	}
Jan 6, 2011
Project Member #1 bar...@gmail.com
Fixed in trunk
Status: Fixed
Labels: Milestone-3.0

Powered by Google Project Hosting