package com.raja.vedioapp;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new BackGround().execute("hi");
}
class BackGround extends AsyncTask<String, Void, String>
{
ProgressDialog progress;
@Override
protected String doInBackground(String... params)
{
for(int i=0;i<=10000;i++)
{
System.out.println("Background Task "+i);
}
return "success";
}
@Override
protected void onPostExecute(String result)
{
System.out.println("BackGround Task Completed Result is "+result);
progress.cancel();
}
@Override
protected void onPreExecute()
{
progress=ProgressDialog.show(MainActivity.this, "Progress", "Please Wait...",true);
}
}
}
Hey There. I discovered your blog site making use of msn. This is an exceptionally well composed guide. I will make sure to bookmark it and come back to review more of your helpful information. Thanks for the post. I'll definitely return.
ReplyDelete