标签:over put public send 发送 xtend key ams end
class CalculateThread extends Thread {
private Handler handler;
@Override
public void run() {
super.run();
Looper.prepare();
handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.what == 0x1233) {
int upperNum = msg.getData().getInt("UPPER_NUM");
List<Integer> integers = calculateZ(upperNum);
Log.e("ouLog" , integers.toString());
}
}
};
Looper.loop();
}
}
//发送到handler
EditText editText = (EditText)findViewById(R.id.upperNum);
String upperNum = editText.getText().toString();
Message msg = new Message();
msg.what = 0x1233;
Bundle bundle = new Bundle();
bundle.putInt("UPPER_NUM", Integer.parseInt(upperNum));
msg.setData(bundle);
calculateThread.handler.sendMessage(msg);
标签:over put public send 发送 xtend key ams end
原文地址:http://www.cnblogs.com/ouyangping/p/7414130.html