Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Very simple: a setter or just a field change. True, we must remember about local copies of the thread data and do not forget to use volatile.
public class T1 extends Thread{
private volatile byte someByte;
public void setData(byte someByte){
this.someByte = someByte;
}
public void run(){
//использование someByte
}
}
in android there are all sorts of different threads..
which one?
Thread?
AsyncTask?
you can make a variable static and refer to it, you can simply declare the variable globally and access is open, many different ways
Describe the task more specifically, please.
Because there are several ways and it's not a fact that an external variable is the best.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question