Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class UpdateDBProgressDialog extends Activity implements Runnable {
- private TextView tv;
- private ProgressDialog pd;
- private RatedCallsService rcs = new RatedCallsService();
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- pd = ProgressDialog.show(this, "Updating Database", "The application is updating the database. Please wait.", true, false);
- Thread thread = new Thread(this);
- thread.start();
- }
- public void run() {
- rcs.updateDB();
- handler.sendEmptyMessage(0);
- }
- private Handler handler = new Handler() {
- @Override
- public void handleMessage(Message msg) {
- pd.dismiss();
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement