new Thread(new Runnable() {
public void run() {
String response = null;
//String res = null;
try {
response = CustomHttpClient.executeHttpPost("http://abc.org/fypcps/furqan.php");
} catch (Exception e) {
// TODO Auto-generated catch block
//Toast.makeText(context, e.toString(), 0).show();
//Log.i("furqan", "ya ALLAH madad");
} //Enetr Your remote PHP,ASP, Servlet file link
String res = response.toString();
// res = res.trim();
//res= res.replaceAll("\\s+","");
//error.setText(res);
//if(res.equals("1"))
//Log.i("furqan1", res);
//else
//Log.i("furqan2", "no string is captured");
response1 = res;
}
}).start();
在我的代码中 response1 是我在线程上方声明的变量,我想将字符串“res”分配给“response1”,但它给了我封闭的类型错误。任何人都可以帮助我解决这个问题。