所以
public class m1 extends Activity {
new m2().execute();
new m3().execute();
class m2 extends AsyncTask<String, String, String> {
public void s {
String id3 = map12.get("CourseID");
}
}
class m3 extends AsyncTask<String, String, String> {
}//m3
}//m
我怎样才能将id3送到m3类?知道这是改变每一天
答案 0 :(得分:0)
将其声明为构造函数的一部分,并在实例化时将其传递(假设您是从m1
调用它。
private String id3;
public m3(String theId3) {
id3 = theId3;
}
答案 1 :(得分:0)
在此类m1中创建id3 public static,然后直接在类m3中访问它,如m1.id3。
public class m1 extends Activity {
public static String id3;
//your code
}
public class m3 {
m1 Object1=new m1(); //make object of class m1
Object1.id3; // You can access id3 in class m3
//your code
}