PROGRESSDIALOG Dialog with progress

Circular progress bar-style Dialog (window)
public void showPD(View view) throws InterruptedException {
final ProgressDialog dialog = ProgressDialog.show(this,"Data loading","Data loading...");
new Thread(new Runnable() {
@Override
public void run() {
for (int i = 0;i<20 ;i++)
{
try {
Thread.sleep(
100);
}
catch (InterruptedException e) {
e.printStackTrace();
}
}
dialog.dismiss();
runOnUiThread(
new Runnable() {
@Override
public void run() {
Toast.makeText(DialogActivity.
this,"Loading complete",Toast .LENGTH_SHORT).show();
}
});
}
}).start();

}

Horizontal progress bar-style Dialog (window)
public void showPD2(View view)

{
final ProgressDialog pd = new ProgressDialog(this);
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
pd.show();

new Thread(new Runnable() {
@Override
public void run() {
pd.setMax(
20);
for(int i =0;i<20 ;i++)
{
try {
Thread.sleep(
100);
}
catch (InterruptedException e) {
e.printStackTrace();
}
pd.setProgress(pd.getProgress()
+1);

}
pd.dismiss();
}
}).start();
}


A show(
ProgressDialog.show) A new (new ProgressDialog(this))

< /p>

Circular progress bar Dialog (window)
public void showPD(View view) throws InterruptedException {
final ProgressDialog dialog = ProgressDialog.show(this,"Data loading","Data loading...");
new Thread(new Runnable() {
@Override
public void run() {
for (int i = 0;i<20 ;i++)
{
try {
Thread.sleep(
100);
}
catch (InterruptedException e) {
e.printStackTrace();
}
}
dialog.dismiss();
runOnUiThread(
new Runnable() {
@Override
public void run() {
Toast.makeText(DialogActivity.
this,"Loading complete",Toast .LENGTH_SHORT).show();
}
});
}
}).start();

}

Horizontal progress bar-style Dialog (window)
public void showPD2(View view)

{
final ProgressDialog pd = new ProgressDialog(this);
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
pd.show();

new Thread(new Runnable() {
@Override
public void run() {
pd.setMax(
20);
for(int i =0;i<20 ;i++)
{
try {
Thread.sleep(
100);
}
catch (InterruptedException e) {
e.printStackTrace();
}
pd.setProgress(pd.getProgress()
+1);

}
pd.dismiss();
}
}).start();
}


A show(
ProgressDialog.show) A new (new ProgressDialog(this))

< p>

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1397 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.