I have an activity. It uses nfc tag. I want to create progress dialog in method CertificateGeneration for shows steps to user. It is my code.
private void CertificateGeneration(Tag mytag)
{
ProgressDialog progress = new ProgressDialog(CertificateGenerationActivity.this);
progress.setMessage("in progress... ");
progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progress.setIndeterminate(true);
progress.show();
Method1();
progress.setMessage("Method1 is executed ");
Method2();
progress.setMessage("Method2 is executed ");}
but when I execute CertificateGeneration method in debuge mode I see all lines are parse without any changes on screen. It does not show progress Message on screen and executes method1. why? at the end of Method (executed Method1 and Method2) It shows progress Message. and only shows " Method2 is executed".
How can I edit my code? or It a beter solution for diplay message at run time in method(not end od method)?
I also wrote a simple method too. It does not have any method. but It is executed completly and only show "progress2"
private void DisplayMsg(final String msg)
{
progress = new ProgressDialog(CertificateGenerationActivity.this);
progress.setMessage("Progress1");
progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progress.setIndeterminate(true);
progress.show();
String f="test";
progress.setMessage("progress2");
}