Search in sources :

Example 86 with ProgressDialog

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();
}
Also used : ProgressDialog(android.app.ProgressDialog)

Example 87 with ProgressDialog

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();
    }
}
Also used : ProgressDialog(android.app.ProgressDialog)

Example 88 with ProgressDialog

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);
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) VolleyError(com.android.volley.VolleyError) DialogInterface(android.content.DialogInterface) JsonObjectRequest(com.android.volley.toolbox.JsonObjectRequest) Request(com.android.volley.Request) JSONException(org.json.JSONException) ProgressDialog(android.app.ProgressDialog) Uri(android.net.Uri) DownloadManager(android.app.DownloadManager) Response(com.android.volley.Response) JSONObject(org.json.JSONObject) JsonObjectRequest(com.android.volley.toolbox.JsonObjectRequest) File(java.io.File)

Example 89 with ProgressDialog

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;
        }
    }
}
Also used : BitmapDecoder(com.google.zxing.decode.BitmapDecoder) Bitmap(android.graphics.Bitmap) Message(android.os.Message) ProgressDialog(android.app.ProgressDialog) Cursor(android.database.Cursor) DecodeThread(com.google.zxing.decode.DecodeThread) Result(com.google.zxing.Result)

Example 90 with ProgressDialog

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();
}
Also used : ProgressDialog(android.app.ProgressDialog)

Aggregations

ProgressDialog (android.app.ProgressDialog)266 DialogInterface (android.content.DialogInterface)47 Intent (android.content.Intent)23 View (android.view.View)21 File (java.io.File)19 TextView (android.widget.TextView)13 SuppressLint (android.annotation.SuppressLint)12 Handler (android.os.Handler)12 FrameLayout (android.widget.FrameLayout)12 ArrayList (java.util.ArrayList)12 IOException (java.io.IOException)11 JSONObject (org.json.JSONObject)10 Uri (android.net.Uri)9 LinearLayout (android.widget.LinearLayout)9 OnCancelListener (android.content.DialogInterface.OnCancelListener)8 Display (android.view.Display)8 Activity (android.app.Activity)7 Dialog (android.app.Dialog)7 ImageView (android.widget.ImageView)7 List (java.util.List)7