Example usage for android.app ProgressDialog show

List of usage examples for android.app ProgressDialog show

Introduction

In this page you can find the example usage for android.app ProgressDialog show.

Prototype

public static ProgressDialog show(Context context, CharSequence title, CharSequence message) 

Source Link

Document

Creates and shows a ProgressDialog.

Usage

From source file:com.pandoroid.PandoroidPlayer.java

@Override
protected void onResume() {
    super.onResume();
    if (m_is_bound) {
        startup();//from  w w w.jav a 2 s .c om
    } else {
        m_waiting = ProgressDialog.show(PandoroidPlayer.this, "", getString(R.string.loading));
    }
}

From source file:com.normalexception.app.rx8club.task.UpdateTask.java

@Override
protected void onPreExecute() {

    if (delete)/*from w w  w  .  j ava  2 s.  c  om*/
        mProgressDialog = ProgressDialog.show(sourceFragment.getActivity(), "Deleting...", "Deleting Post...");
    else
        mProgressDialog = ProgressDialog.show(sourceFragment.getActivity(), "Submitting...",
                "Submitting Post...");
}

From source file:com.rvl.android.getnzb.LocalNZB.java

public void uploadLocalFileHellaNZB(String filename) {
    UPLOADDIALOG = ProgressDialog.show(this, "Please wait...",
            "Uploading '" + filename + "' to HellaNZB server.");

    UPLOADFILENAME = filename;/*from   w w w  .  j a v a2  s. co  m*/
    SharedPreferences prefs = GetNZB.preferences;
    if (prefs.getString("hellanzb_hostname", "") == "") {
        uploadDialogHandler.sendEmptyMessage(0);
        Log.d(Tags.LOG, "No HellaNZB settings Toast");
        Toast.makeText(this, "Upload to HellaNZB not possible, please check HellaNZB preferences.",
                Toast.LENGTH_LONG).show();
        return;

    }

    new Thread() {
        @SuppressWarnings("unchecked")
        public void run() {
            Log.d(Tags.LOG, "- uploadLocalFileHellaNZB():");
            File uploadfile = new File(getFilesDir() + "/" + UPLOADFILENAME);
            String filedata;
            try {
                filedata = readFile(uploadfile);
                @SuppressWarnings("unused")
                HashMap<String, Object> response = (HashMap<String, Object>) HELLACONNECTION.call("enqueue",
                        uploadfile.getName(), filedata);

            } catch (IOException e) {
                Log.d(Tags.LOG, "uploadLocalFile(): IOException: " + e.getMessage());
            }
            removeLocalNZBFile(UPLOADFILENAME);
            UPLOADFILENAME = "";
            uploadDialogHandler.sendEmptyMessage(0);
        }

    }.start();
}

From source file:com.normalexception.app.rx8club.task.SubmitTask.java

@Override
protected void onPreExecute() {

    mProgressDialog = ProgressDialog.show(sourceActivity.getActivity(), "Submitting...", "Please Wait...");
}

From source file:com.esri.UC.MainActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    LicenseResult licenseResult = ArcGISRuntime.setClientId(AGO_CLIENT_ID);

    setContentView(R.layout.activity_main);

    mGeotriggerBroadcastReceiver = new GeotriggerBroadcastReceiver();
    mShouldCreateTrigger = false;/*from  www. j  a v  a2  s.c o  m*/
    mShouldSendNotification = true;
    mMapView = (MapView) findViewById(R.id.map);

    // Tap on the map and show popups for selected features.
    mMapView.setOnSingleTapListener(new OnSingleTapListener() {
        private static final long serialVersionUID = 1L;

        public void onSingleTap(float x, float y) {
            if (mMapView.isLoaded()) {
                // Instantiate a PopupContainer
                popupContainer = new PopupContainer(mMapView);
                int id = popupContainer.hashCode();
                popupDialog = null;
                // Display spinner.
                if (progressDialog == null || !progressDialog.isShowing())
                    progressDialog = ProgressDialog.show(mMapView.getContext(), "", "Querying...");

                // Loop through each layer in the webmap
                int tolerance = 20;
                Envelope env = new Envelope(mMapView.toMapPoint(x, y), 20 * mMapView.getResolution(),
                        20 * mMapView.getResolution());
                Layer[] layers = mMapView.getLayers();
                count = new AtomicInteger();
                for (Layer layer : layers) {
                    // If the layer has not been initialized or is invisible, do nothing.
                    if (!layer.isInitialized() || !layer.isVisible())
                        continue;

                    if (layer instanceof ArcGISFeatureLayer) {
                        Log.d("querying", "a featurelayer");
                        // Query feature layer and display popups
                        ArcGISFeatureLayer featureLayer = (ArcGISFeatureLayer) layer;
                        if (featureLayer.getPopupInfo() != null) {
                            // Query feature layer which is associated with a popup definition.
                            count.incrementAndGet();
                            new RunQueryFeatureLayerTask(x, y, tolerance, id).execute(featureLayer);
                        }
                    }
                }
            }
        }
    });

    SharedPreferences prefs = getSharedPreferences(MainActivity.class.getSimpleName(), Context.MODE_PRIVATE);
    String registrationId = prefs.getString("registration_id", "");
    Log.d("registration", registrationId);

}

From source file:gr.scify.newsum.ui.SearchViewActivity.java

private void showWaitingDialog() {
    runOnUiThread(new Runnable() {
        @Override//  w ww  . j a v a2  s  . com
        public void run() {
            if (pd == null)
                // show progress dialog
                pd = ProgressDialog.show(SearchViewActivity.this, "",
                        getResources().getText(R.string.wait_msg));
            else
                pd.show();
        }
    });
}

From source file:com.adwardstark.lyricswithmusixmatchapi.MainActivity.java

private void searchSong(final String songname) {
    try {/*w w w  .  ja  v  a 2s .c o m*/

        class SearchSongAsync extends AsyncTask<String, Void, String> {

            private Dialog loadingDialog;

            @Override
            protected void onPreExecute() {
                super.onPreExecute();
                loadingDialog = ProgressDialog.show(MainActivity.this, "Please wait", "Searching for song...");
            }

            @Override
            protected String doInBackground(String... params) {

                String result = null;
                InputStream inputStream = null;
                try {
                    String link = "http://api.musixmatch.com/ws/1.1/track.search?apikey=" + apiKey + "&q_track="
                            + songname + "&format=json&page_size=10";
                    URL url = new URL(link);
                    HttpClient client = new DefaultHttpClient();
                    HttpGet request = new HttpGet();
                    request.setURI(new URI(link));
                    HttpResponse response = client.execute(request);

                    HttpEntity entity = response.getEntity();

                    inputStream = entity.getContent();
                    // json is UTF-8 by default
                    BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"), 8);
                    StringBuilder sb = new StringBuilder();

                    String line = null;
                    while ((line = reader.readLine()) != null) {
                        sb.append(line + "\n");
                    }
                    result = sb.toString();
                } catch (Exception e) {
                    e.printStackTrace();
                } finally {
                    try {
                        if (inputStream != null)
                            inputStream.close();
                    } catch (Exception squish) {
                    }
                }
                return result;
            }

            @Override
            protected void onPostExecute(String result) {
                myJSON = result;
                loadingDialog.dismiss();
                checkResult();
            }
        }

        SearchSongAsync la = new SearchSongAsync();
        la.execute();
    } catch (Exception ex) {
        Toast.makeText(getBaseContext(), "You are not connected", Toast.LENGTH_LONG).show();
    }

}

From source file:it.mb.whatshare.SendToGCMActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    tracker = GoogleAnalytics.getInstance(this).getDefaultTracker();
    if ("".equals(registrationID)) {
        if (!Utils.isConnectedToTheInternet(this)) {
            Dialogs.noInternetConnection(this, R.string.no_internet_sending, true);
        } else {//from   w  w w.  j  av  a  2 s. c  om
            GCMIntentService.registerWithGCM(this);
            new AsyncTask<Void, Void, Void>() {

                private ProgressDialog dialog;

                /*
                 * (non-Javadoc)
                 * 
                 * @see android.os.AsyncTask#onPreExecute()
                 */
                @Override
                protected void onPreExecute() {
                    dialog = ProgressDialog.show(SendToGCMActivity.this,
                            getResources().getString(R.string.please_wait),
                            getResources().getString(R.string.wait_registration));
                }

                @Override
                protected Void doInBackground(Void... params) {
                    try {
                        registrationID = GCMIntentService.getRegistrationID();
                    } catch (CantRegisterWithGCMException e) {
                        registrationError = e.getMessageID();
                    }
                    return null;
                }

                /*
                 * (non-Javadoc)
                 * 
                 * @see android.os.AsyncTask#onPostExecute(java.lang.Object)
                 */
                @Override
                protected void onPostExecute(Void result) {
                    super.onPostExecute(result);
                    dialog.dismiss();
                    if (registrationError != -1) {
                        Dialogs.onRegistrationError(registrationError, SendToGCMActivity.this, true);
                    } else {
                        onNewIntent(getIntent());
                    }
                }
            }.execute();
        }
    }
}

From source file:com.normalexception.app.rx8club.task.AdminTask.java

@Override
protected void onPreExecute() {
    mProgressDialog = ProgressDialog.show(sourceFragment.getActivity(), progressText.get(doType),
            "Please Wait...");
}

From source file:com.rvl.android.getnzb.GetNZB.java

public void button_handler(View v) {
    switch (v.getId()) {
    case R.id.button_login:
        if (preferences.getString("nzbsusername", "") == "")
            showDialog(DIALOG_NO_NZBS_SETTINGS);
        else {// w ww. ja  v a  2  s  .c  om
            pd = ProgressDialog.show(GetNZB.this, "http://www.nzbs.org", "Logging in, please wait...");
            login();

        }
        break;
    case R.id.button_localnzb:
        //if(preferences.getString("hellanzb_hostname", "")=="")
        //   showDialog(DIALOG_NO_HELLANZB_SETTINGS);
        //else 
        startLocalNZB();
        break;
    case R.id.button_monitor:
        startMonitor();
        break;
    }
}