Wednesday, 18 September 2013

Android Runable class - cannot access property from run() method

Android Runable class - cannot access property from run() method

class MyRunnable implements Runnable{
public StringBuffer line2;
public MyRunnable(StringBuffer _line){
this.line2 = _line;
Log.w("LINE", this.line2.toString());
}
public void run(){
SpannableString read = new SpannableString("READ:> " +
this.line2.toString() + "\n");
read.setSpan(new ForegroundColorSpan(Color.GREEN), 0, 6, 0);
console.append(this.line2.toString());
}
}
This is my code... I have the problem that when accessing line2 from run()
method it has 0 length.
Any idea where I'm wrong?

No comments:

Post a Comment