[android]代码库
public void select(View v){
String string = editText.getText().toString().trim();
MyAsynctask asynctask=new MyAsynctask();
asynctask.execute(string);
}
class MyAsynctask extends AsyncTask<String, Void, Bean>{
@Override
protected Bean doInBackground(String... params) {
// TODO Auto-generated method stub
Bean bean = getdate(params[0]);
return bean;
}
@Override
protected void onPostExecute(Bean result1) {
// TODO Auto-generated method stub
t1.setText("成语解释:"+result1.result.chengyujs);
t2.setText("出自:"+result1.result.from_);
t3.setText("举例:"+result1.result.example);
t4.setText("词语解释:"+result1.result.ciyujs);
super.onPostExecute(result1);
}
}
by: 发表于:2017-10-18 09:18:22 顶(0) | 踩(0) 回复
??
回复评论