I\'m establishing a server connection, my problem is that I need to put an AsyncTask
on my code, because its not working in sdk version 10
up. I do
Refer below code
new FetchRSSFeeds().execute();
private class FetchRSSFeeds extends AsyncTask {
private ProgressDialog dialog = new ProgressDialog(HomeActivity.this);
/** progress dialog to show user that the backup is processing. */
/** application context. */
protected void onPreExecute() {
this.dialog.setMessage(getResources().getString(
R.string.Loading_String));
this.dialog.show();
}
protected Boolean doInBackground(final String... args) {
try {
/**
* Write your URL connection code and fetch data here
*/
return true;
} catch (Exception e) {
Log.e("tag", "error", e);
return false;
}
}
@Override
protected void onPostExecute(final Boolean success) {
if (dialog.isShowing()) {
dialog.dismiss();
}
/* Show the String on the GUI. */
aTextView.setText(aString);
this.setContentView(aTextView);
}
}