Example usage for android.app ProgressDialog setMessage

List of usage examples for android.app ProgressDialog setMessage

Introduction

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

Prototype

@Override
    public void setMessage(CharSequence message) 

Source Link

Usage

From source file:org.silena.main.RegistrationOld.java

@Override
protected Dialog onCreateDialog(int dialogId) {
    ProgressDialog progress = null;
    switch (dialogId) {
    case PROGRESS_DLG_ID:
        progress = new ProgressDialog(this);
        progress.setMessage("Loading...");

        break;// ww  w .j av a2  s .  c o  m
    }
    return progress;
}

From source file:ca.ualberta.cmput301w14t08.geochan.fragments.CustomLocationFragment.java

/**
 * Sets up listeners for the marker passed in. First sets up the
 * onMarkerClick listener, which hides all infoWindows and then shows the
 * infoWindow of the marker that was clicked. Second, if the marker is
 * draggable,//from   ww  w  .  j av  a  2s.  c o m
 * 
 * @param locationMarker
 *            The CustomMarker to have listeners set up for.
 */
private void setMarkerListeners(CustomMarker locationMarker) {

    locationMarker.setOnMarkerClickListener(new OnMarkerClickListener() {

        /**
         * called if marker is clicked, hides all other infoWindows
         */
        @Override
        public boolean onMarkerClick(Marker marker, MapView map) {
            if (marker.isInfoWindowShown() != true) {
                hideInfoWindows();
                marker.showInfoWindow();
            } else {
                hideInfoWindows();

            }
            return false;
        }
    });

    if (locationMarker.isDraggable()) {
        locationMarker.setOnMarkerDragListener(new OnMarkerDragListener() {

            /**
             * Called as the marker is being dragged, no implementation
             * 
             * @param marker
             *            that was dragged
             */
            @Override
            public void onMarkerDrag(Marker marker) {
            }

            /**
             * Called when the onDragListen action is complete Updates the
             * location and POI when the drag is finished
             * 
             * @param marker
             *            that was dragged
             */
            @Override
            public void onMarkerDragEnd(Marker marker) {
                GeoLocation geoLocation = new GeoLocation(marker.getPosition().getLatitude(),
                        marker.getPosition().getLongitude());
                ProgressDialog dialog = new ProgressDialog(getActivity());
                dialog.setMessage("Retrieving Location");
                ThreadManager.startGetPOI(geoLocation, dialog, marker);
            }

            /**
             * Called when the drag operation begins. No implementation at
             * this time
             * 
             * @param marker
             *            that was dragged
             */
            @Override
            public void onMarkerDragStart(Marker marker) {
                hideInfoWindows();
            }
        });
    }
}

From source file:com.mobility.android.ui.vehicle.AddVehicleActivity.java

private void uploadPicture(File file) {
    ProgressDialog dialog = new ProgressDialog(this, R.style.DialogStyle);
    dialog.setMessage("Loading image...");
    dialog.setIndeterminate(true);//from   w w  w.java  2 s. co  m
    dialog.setCancelable(false);
    dialog.show();

    Glide.with(AddVehicleActivity.this).load(file).animate(android.R.anim.fade_in).into(imageBackground);

    base64(file).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
            .subscribe(new Observer<String>() {
                @Override
                public void onCompleted() {

                }

                @Override
                public void onError(Throwable e) {
                    e.printStackTrace();
                    dialog.dismiss();

                    UIUtils.okDialog(AddVehicleActivity.this, "Error", "Couldn't load image.");
                }

                @Override
                public void onNext(String s) {
                    Timber.w("Loaded image base64, size: %s KB", s.length() / 1024);
                    vehicle.image = s;

                    dialog.dismiss();
                }
            });
}

From source file:com.google.android.apps.tvremote.PairingActivity.java

private ProgressDialog buildProgressDialog() {
    ProgressDialog dialog = new ProgressDialog(this);
    dialog.setMessage(getString(R.string.pairing_waiting));
    dialog.setOnKeyListener(new DialogInterface.OnKeyListener() {
        public boolean onKey(DialogInterface dialogInterface, int which, KeyEvent event) {
            if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
                cancelPairing();/*from  w w  w .j  av  a 2 s .c  o m*/
                return true;
            }
            return false;
        }
    });
    dialog.setButton(getString(R.string.pairing_cancel), new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialogInterface, int which) {
            cancelPairing();
        }
    });
    return dialog;
}

From source file:com.liquid.wallpapers.free.ScroidWallpaperGallery.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    this.setTheme(android.R.style.Theme_NoTitleBar);
    this.setContentView(R.layout.main);

    // initializing gallery
    this.initGallery();

    // filling gallery
    ProgressDialog progressDialog = new ProgressDialog(this);
    progressDialog.setMessage(this.getString(R.string.loadingText));

    if (this.wallpaperGalleryAdapter != null) {
        this.updateGalleryAdapter();

        return;/*from w w  w. j a  v a 2  s.c o m*/
    }

    new FillGalleryTask(progressDialog, this).start();
}

From source file:com.shengtao.chat.chatUI.activity.ContactlistFragment.java

/**
 * ?/*  w w w.  j a  va2  s .  com*/
 *
 * @param toDeleteUser
 */
public void deleteContact(final User tobeDeleteUser) {
    String st1 = getResources().getString(R.string.deleting);
    final String st2 = getResources().getString(R.string.Delete_failed);
    final ProgressDialog pd = new ProgressDialog(getActivity());
    pd.setMessage(st1);
    pd.setCanceledOnTouchOutside(false);
    pd.show();
    new Thread(new Runnable() {
        public void run() {
            try {
                EMContactManager.getInstance().deleteContact(tobeDeleteUser.getUsername());
                // db?
                UserDao dao = new UserDao(getActivity());
                dao.deleteContact(tobeDeleteUser.getUsername());
                UIApplication.getContext().getContactList().remove(tobeDeleteUser.getUsername());
                getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        pd.dismiss();
                        adapter.remove(tobeDeleteUser);
                        adapter.notifyDataSetChanged();

                    }
                });
            } catch (final Exception e) {
                getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        pd.dismiss();
                        Toast.makeText(getActivity(), st2 + e.getMessage(), Toast.LENGTH_SHORT).show();
                    }
                });

            }

        }
    }).start();

}

From source file:me.panpf.tool4a.app.ProgressDialogFragment.java

/**
 * ?//  w ww .  ja  va2  s  .c  o  m
 *
 * @param progressDialog ?
 */
private void applyParams(ProgressDialog progressDialog) {
    if (builder == null)
        throw new IllegalArgumentException("builder null ?setBuilder()Builder");

    progressDialog.setTitle(builder.title);
    progressDialog.setMessage(builder.message != null ? builder.message
            : (Locale.CHINA.equals(Locale.getDefault()) ? MESSAGE_DEFAULT_CHINA : MESSAGE_DEFAULT_OTHER));
    if (builder.confirmButtonName != null) {
        progressDialog.setButton(AlertDialog.BUTTON_POSITIVE, builder.confirmButtonName,
                builder.confirmButtonClickListener);
    }
    if (builder.cancelButtonName != null) {
        progressDialog.setButton(AlertDialog.BUTTON_NEGATIVE, builder.cancelButtonName,
                builder.cancelButtonClickListener);
    }
    if (builder.neutralButtonName != null) {
        progressDialog.setButton(AlertDialog.BUTTON_NEUTRAL, builder.neutralButtonName,
                builder.neutralButtonClickListener);
    }
    progressDialog.setOnKeyListener(builder.onKeyListener);
    progressDialog.setOnShowListener(builder.onShowListener);
    setCancelable(builder.cancelable);
}

From source file:com.example.prasadnr.traquad.TraQuad.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_tra_quad);
    ConnectivityManager connManager = (ConnectivityManager) getSystemService(TraQuad.CONNECTIVITY_SERVICE);
    NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
    Builder alert = new AlertDialog.Builder(TraQuad.this);

    WifiManager managerWifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
    Method[] wmMethods = managerWifi.getClass().getDeclaredMethods();
    for (Method method : wmMethods) {
        if (method.getName().equals("isWifiApEnabled")) {

            try {
                isWifiAPenabled = (boolean) method.invoke(managerWifi);
            } catch (IllegalArgumentException e) {
                e.printStackTrace();//from  w w  w  . j  a v  a2 s.  com
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            }
        }
    }

    final ProgressDialog pDialog;
    MediaController mediaController = new MediaController(this);

    pDialog = new ProgressDialog(TraQuad.this);
    pDialog.setTitle("TraQuad app (Connecting...)");
    pDialog.setMessage("Buffering...Please wait...");
    pDialog.setCancelable(true);

    if (!isWifiAPenabled) {

        alert.setTitle("WiFi Hotspot Settings");
        alert.setMessage("Can you please connect WiFi-hotspot?");
        alert.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                irritation = true;
                startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS));
                pDialog.show();
            }
        });
        alert.setNegativeButton("No", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                //Dismiss AlertDialog
                pDialog.show();
                Toast.makeText(getApplicationContext(), "Please connect your WiFi!", Toast.LENGTH_LONG).show();
            }
        });
        alert.setCancelable(false);
        AlertDialog alertDialog = alert.create();
        alertDialog.show();
    }

    WebView webView = (WebView) findViewById(R.id.webView);

    if (irritation == true | isWifiAPenabled) {
        pDialog.show();
    }

    mediaController.setAnchorView(webView);
    mediaController.setVisibility(View.GONE);

    extra = getIntent().getStringExtra("VideosId");
    webView = (WebView) findViewById(R.id.webView);
    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setPluginState(WebSettings.PluginState.ON);

    final GlobalClass globalVariable = (GlobalClass) getApplicationContext();
    final String IPaddressNew = globalVariable.getIP();
    final String httpString = "http://";
    final String commandPort = String.valueOf(1500);
    final String streamPort = String.valueOf(8080);
    final String IPaddressStream = httpString + IPaddressNew + ":" + streamPort;
    final String IPaddressCommand = httpString + IPaddressNew + ":" + commandPort;
    TextView sendCharacter = (TextView) findViewById(R.id.sendCharacter);

    try {
        webView.loadUrl(IPaddressStream);
    } catch (Exception e) {
        Toast.makeText(getApplicationContext(), IPaddressNew + ":Error!", Toast.LENGTH_LONG).show();
    }

    webView.setWebViewClient(new WebViewClient() {
        public void onPageFinished(WebView view, String url) {
            pDialog.dismiss();
        }
    });

    final Button switchact = (Button) findViewById(R.id.btn2);
    switchact.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            Intent act1 = new Intent(view.getContext(), Joypad.class);
            startActivity(act1);

        }
    });

    final Button hometraquad = (Button) findViewById(R.id.button5);

    hometraquad.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {

            Intent acthometraquad = new Intent(TraQuad.this, MainActivity.class);
            startActivity(acthometraquad);
        }
    });

}

From source file:com.androidquery.simplefeed.base.BaseActivity.java

public ProgressDialog makeProgressDialog(String message) {

    ProgressDialog dialog = new ProgressDialog(this);
    dialog.setIndeterminate(true);//  ww  w .j a v  a  2  s.  c om
    dialog.setCancelable(true);
    dialog.setInverseBackgroundForced(false);
    dialog.setCanceledOnTouchOutside(true);
    dialog.setMessage(message);

    return dialog;

}

From source file:cn.xcom.helper.chat.ui.SettingsFragment.java

void logout() {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    String st = getResources().getString(R.string.Are_logged_out);
    pd.setMessage(st);
    pd.setCanceledOnTouchOutside(false);
    pd.show();/*from   w ww. ja  v  a 2  s.co m*/
    DemoHelper.getInstance().logout(false, new EMCallBack() {

        @Override
        public void onSuccess() {
            getActivity().runOnUiThread(new Runnable() {
                public void run() {
                    pd.dismiss();
                    // show login screen
                    ((MainActivity) getActivity()).finish();
                    startActivity(new Intent(getActivity(), LoginActivity.class));

                }
            });
        }

        @Override
        public void onProgress(int progress, String status) {

        }

        @Override
        public void onError(int code, String message) {
            getActivity().runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    // TODO Auto-generated method stub
                    pd.dismiss();
                    Toast.makeText(getActivity(), "unbind devicetokens failed", Toast.LENGTH_SHORT).show();
                }
            });
        }
    });
}