I am using ProgressDialog in my app but on running the app errors occurred.
Here is the code
public class MainActivity extends Activity{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
ProgressDialog mDialog = new ProgressDialog(getApplicationContext());
mDialog.setMessage("Loading...");
mDialog.setCancelable(false);
mDialog.show();
}
}
Updated Code:
public class MainActivity extends Activity{
public static ProgressDialog dialog;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
private static abstract class DictionaryOpenHelper extends SQLiteOpenHelper {
public DictionaryOpenHelper() {
super(null, null, null, 0);
// TODO Auto-generated constructor stub
}
public void onCreate() {
// TODO Auto-generated method stub
ProgressDialog dialog = ProgressDialog.show(DictionaryOpenHelper.this, "",
"Loading. Please wait...", true);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// TODO Auto-generated method stub
}
}
}
and give error on ProgressDialog dialog = ProgressDialog.show(DictionaryOpenHelper.this, “”,
“Loading. Please wait…”, true); :The method show(Context, CharSequence, CharSequence, boolean) in the type ProgressDialog is not applicable for the arguments (MainActivity.DictionaryOpenHelper, String, String, boolean)
Load and Unload Progress Dialog Can be Attempt with the Following Snippet
make it a part of UIThread
///load
///////Unload