I Can't use findViewById()
from my Kclass=( How can i use it? `
private class BackGroundTask extends AsyncTask<Void, Void, Void>{
@Override
protected Void doInBackground(Void... params) {
try {
//execute - means sending
response =httpClient.execute(request);
HttpEntity entity=response.getEntity();
String str=EntityUtils.toString(entity);
Log.v("Json=", str);
//adding new response to our Response Class
resp.addNewResponse(str);
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
Log.e(TAG, "Exception caught: ", e);
}
return null;
}
protected void onPostExecute(Void result) {
super.onPostExecute(result);
httpClient.getConnectionManager().shutdown();
TextView textView = (TextView) findViewById(R.id.textView1);
textView.setText("Done");
}
}
}
please write an exact code. This class is in another .java file. Not in MainActivity.java