use of android.app.ProgressDialog in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class OpenCellIdActivity method onAcceptedClicked.
public void onAcceptedClicked(View v) {
pd = new ProgressDialog(this);
pd.setMessage(getString(R.string.getting_ocid_key));
pd.show();
OpenCellIdKeyDownloaderTask ocikd = new OpenCellIdKeyDownloaderTask();
//starts background thread
ocikd.execute();
}
use of android.app.ProgressDialog in project boxing by Bilibili.
the class BoxingBottomSheetFragment method showProgressDialog.
private void showProgressDialog() {
if (mDialog == null) {
mDialog = new ProgressDialog(getActivity());
mDialog.setIndeterminate(true);
mDialog.setMessage(getString(R.string.handling));
}
if (!mDialog.isShowing()) {
mDialog.show();
}
}
use of android.app.ProgressDialog in project saga-android by AnandChowdhary.
the class Updater method checkForUpdates.
public static void checkForUpdates(final Context context, boolean visibility) {
final int versionCode = getVersionCode(context);
final ProgressDialog progressDialog = new ProgressDialog(context);
String updateUrl = "https://www.dropbox.com/s/bka9o3p43oki217/saga.json?raw=1";
if (visibility) {
progressDialog.setTitle(context.getString(R.string.update));
progressDialog.setMessage(context.getString(R.string.update_checking));
progressDialog.setCancelable(true);
progressDialog.show();
}
JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, updateUrl, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
int updateVersionCode = response.getInt("versionCode");
if (updateVersionCode > versionCode && versionCode != 0) {
if (progressDialog.isShowing()) {
progressDialog.cancel();
}
final String apkUrl = response.getString("apkUrl");
String changelog = response.getString("changelog");
AlertDialog dialog = new AlertDialog.Builder(context).setTitle(context.getString(R.string.new_update)).setMessage(changelog).setPositiveButton(context.getString(R.string.update_now), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
File myFile = new File(Utils.getStoragePath(context), "update.apk");
if (myFile.exists())
myFile.delete();
Uri uri = Uri.parse(apkUrl);
DownloadManager dMgr = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
DownloadManager.Request dr = new DownloadManager.Request(uri);
String filename = "update.apk";
dr.setTitle(context.getString(R.string.app_name) + " " + context.getString(R.string.update));
dr.setDestinationUri(Uri.fromFile(new File(Utils.getStoragePath(context) + "/" + filename)));
// dr.setDestinationInExternalPublicDir("/Saga/", filename);
dMgr.enqueue(dr);
}
}).setNegativeButton(context.getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}).setCancelable(false).create();
dialog.show();
} else {
if (progressDialog.isShowing()) {
progressDialog.cancel();
Toast.makeText(context, context.getString(R.string.no_update), Toast.LENGTH_SHORT).show();
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
if (progressDialog.isShowing()) {
progressDialog.cancel();
Toast.makeText(context, context.getString(R.string.error_connect), Toast.LENGTH_SHORT).show();
}
}
});
request.setShouldCache(false);
VolleySingleton.getInstance(context).getRequestQueue().add(request);
}
use of android.app.ProgressDialog in project QRCode by 5peak2me.
the class CaptureActivity method onActivityResult.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (resultCode == RESULT_OK) {
final ProgressDialog progressDialog;
switch(requestCode) {
case REQUEST_CODE:
// 获取选中图片的路径
Cursor cursor = getContentResolver().query(intent.getData(), null, null, null, null);
if (cursor.moveToFirst()) {
photoPath = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.DATA));
}
cursor.close();
progressDialog = new ProgressDialog(this);
progressDialog.setMessage("正在扫描...");
progressDialog.setCancelable(false);
progressDialog.show();
new Thread(new Runnable() {
@Override
public void run() {
Bitmap img = BitmapUtils.getCompressedBitmap(photoPath);
BitmapDecoder decoder = new BitmapDecoder(CaptureActivity.this);
Result result = decoder.getRawResult(img);
if (result != null) {
Message m = mHandler.obtainMessage();
m.what = PARSE_BARCODE_SUC;
m.obj = ResultParser.parseResult(result).toString();
mHandler.sendMessage(m);
} else {
Message m = mHandler.obtainMessage();
m.what = PARSE_BARCODE_FAIL;
mHandler.sendMessage(m);
}
progressDialog.dismiss();
}
}).start();
break;
}
}
}
use of android.app.ProgressDialog in project AntennaPod by AntennaPod.
the class OpmlFeedQueuer method onPreExecute.
@Override
protected void onPreExecute() {
progDialog = new ProgressDialog(context);
progDialog.setMessage(context.getString(R.string.processing_label));
progDialog.setCancelable(false);
progDialog.setIndeterminate(true);
progDialog.show();
}
Aggregations