Example usage for android.app ProgressDialog ProgressDialog

List of usage examples for android.app ProgressDialog ProgressDialog

Introduction

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

Prototype

public ProgressDialog(Context context) 

Source Link

Document

Creates a Progress dialog.

Usage

From source file:com.aknowledge.v1.automation.RemoteActivity.java

public void startProgressBar() {
    dialog = new ProgressDialog(this);
    dialog.setIndeterminate(true);//from  w w  w . j  av  a 2  s  .c om
    dialog.setCancelable(false);
    dialog.setMessage("Talking to your pytomation server! Please wait...!");
    dialog.show();
}

From source file:com.TakeTaxi.jy.MainMapScreen.java

@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);//  w  w w.  j  av  a 2  s.c om

    // map drawables
    map = (MapView) findViewById(R.id.mvMain);
    driverMarker = getResources().getDrawable(R.drawable.cabs);
    clientMarker = getResources().getDrawable(R.drawable.greendot);
    selectedDriverMarker = getResources().getDrawable(R.drawable.marker);

    // Star bar
    starhalf = getResources().getDrawable(R.drawable.starhalf);
    starwhole = getResources().getDrawable(R.drawable.starwhole);
    starempty = getResources().getDrawable(R.drawable.starempty);
    starbar = (LinearLayout) findViewById(R.id.starbar);
    starbar.setVisibility(8);
    star1 = (ImageView) findViewById(R.id.star1);
    star2 = (ImageView) findViewById(R.id.star2);
    star3 = (ImageView) findViewById(R.id.star3);
    star4 = (ImageView) findViewById(R.id.star4);
    star5 = (ImageView) findViewById(R.id.star5);

    // ////// Temporary Position //////
    tempLat = 1318200;
    tempLongi = 103911651;
    // ////////////////////////////////

    // //// check prefs for name num details ///////
    String prefname = getSharedPreferences(prefFile, 0).getString(nameString, "");
    String prefnum = getSharedPreferences(prefFile, 0).getString(numString, "");
    if (prefname == null || prefnum == null || prefname.equals("") || prefnum.equals("")) {
        Intent openStart = new Intent("com.TakeTaxi.jy.Prefs");
        startActivity(openStart);
    }

    // Position information
    newLat = tempLat;
    newLongi = tempLongi;
    overlayList = map.getOverlays();

    getLocalPosition();
    selectedDriver = 0;
    map.getOverlays().add(new MyPosition(clientMarker));
    localPositionGeoPoint = new GeoPoint(tempLat, tempLongi);

    // mapview settings //
    map.getController().setCenter(localPositionGeoPoint);
    map.getController().setZoom(17);

    // flag button //
    bFlag = (Button) findViewById(R.id.bFlag);
    bFlag.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            Intent openStart = new Intent(getBaseContext(), SubmitJobScreen.class);
            openStart.putExtra("driver_id", driver_id);
            openStart.putExtra("tempLat", newLat);
            openStart.putExtra("tempLongi", newLongi);
            openStart.putExtra("geoadd", geoadd);
            startActivity(openStart);
        }
    });
    tvNearest = (TextView) findViewById(R.id.tvNearest);
    setGeoText();
    getNearestTime();

    handlerboolean = true;

    //  PROFILE BUTTON //
    profileButton();

    // CENTRE MAP BUTTON //
    centreMapButton();

    // BROADCAST BUTTON //
    broadcastButton();

    //Error in connection progressdialog //
    pdDC = new ProgressDialog(this);

}

From source file:com.easemob.chatuidemo.adapter.NewFriendsMsgAdapter.java

/**
 * ???/*from w w  w.  j a  v  a  2s  .  co m*/
 *
 * @param button
 * @param username
 */
public void acceptInvitation(final Button button, final InviteMessage msg) {
    final ProgressDialog pd = new ProgressDialog(context);
    String str1 = context.getResources().getString(R.string.Are_agree_with);
    final String str2 = context.getResources().getString(R.string.Has_agreed_to);
    final String str3 = context.getResources().getString(R.string.Agree_with_failure);
    pd.setMessage(str1);
    pd.setCanceledOnTouchOutside(false);
    pd.show();

    RequestQueue requestQueue = Volley.newRequestQueue(context);

    requestQueue.start();

    requestQueue.add(new AutoLoginRequest(context, Request.Method.POST, Model.PathLoad,
            new Response.Listener<JSONObject>() {
                @Override
                public void onResponse(JSONObject response) {
                    pd.dismiss();
                    button.setText(str2);
                    msg.setStatus(InviteMesageStatus.AGREED);
                    // db
                    ContentValues values = new ContentValues();
                    values.put(InviteMessgeDao.COLUMN_NAME_STATUS, msg.getStatus().ordinal());
                    messgeDao.updateMessage(msg.getId(), values);
                    button.setBackgroundDrawable(null);
                    button.setEnabled(false);

                }
            }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    Toast.makeText(context, str3 + error.getMessage(), 1).show();

                }
            }) {
        @Override
        protected void setParams(Map<String, String> params) {
            if (msg.getGroupId() == null) {//???
                params.put("sys", "msg");
                params.put("ctrl", "msger");
                params.put("action", "add_friend");
                params.put("friend_name", msg.getFrom());
            } else //??
            {
                params.put("sys", "msg");
                params.put("ctrl", "msger");
                params.put("action", "agree_group");
                params.put("stranger", msg.getFrom());
                params.put("group_sn", msg.getGroupId());
            }

        }
    });
}

From source file:com.fabernovel.alertevoirie.HomeActivity.java

@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case DIALOG_PROGRESS:
        ProgressDialog pd = new ProgressDialog(this);
        pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        pd.setIndeterminate(true);//from w  ww .jav  a 2s  .co m
        pd.setOnDismissListener(new OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialog) {
                if (dialog_shown)
                    removeDialog(DIALOG_PROGRESS);
            }
        });
        pd.setOnCancelListener(new OnCancelListener() {
            @Override
            public void onCancel(DialogInterface dialog) {
                AVService.getInstance(HomeActivity.this).cancelTask();
                finish();
            }
        });
        pd.setMessage(getString(R.string.ui_message_loading));
        return pd;

    default:
        return super.onCreateDialog(id);
    }
}

From source file:com.easemob.chatuidemo.activity.NewGroupActivity.java

public void setGroup(final String groupName, final String groupIntroduce, final String open,
        final String number, final String allow_invite) {
    final ProgressDialog pd = new ProgressDialog(this);
    pd.setMessage("");
    pd.setCanceledOnTouchOutside(false);
    pd.show();//from w  ww .j  av a  2s.c o  m
    Log.i("FriMsg", groupName + groupIntroduce + open + number + allow_invite);
    RequestQueue requestQueue = Volley.newRequestQueue(this);

    requestQueue.start();

    requestQueue.add(new AutoLoginRequest(this, Request.Method.POST, Model.PathLoad,
            new Response.Listener<JSONObject>() {
                @Override
                public void onResponse(JSONObject response) {
                    Log.i("FriMsg", response.toString());
                    try {
                        if (response.getString("status").equals("0")) {
                            Toast.makeText(NewGroupActivity.this, "?", 0).show();
                            NewGroupActivity.this.finish();
                        }

                    } catch (Exception e) {
                        Log.e("Activity_boshu_FriMsg", "?");
                    }
                    pd.dismiss();

                }
            }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    Log.i("FriMsg", error.getMessage());
                    pd.dismiss();

                }
            }) {
        @Override
        protected void setParams(Map<String, String> params) {
            params.put("sys", "msg");
            params.put("ctrl", "msger");
            params.put("action", "crt_group");
            params.put("group_name", groupName);
            params.put("introduce", groupIntroduce);
            params.put("maxusers", "5000");
            params.put("public", open);
            params.put("approval", "1");
            params.put("members", number);
            params.put("allow_invite", allow_invite);

        }
    });
}

From source file:com.cs528.style.style.weather.WeatherActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    // Initialize the associated SharedPreferences file with default values
    PreferenceManager.setDefaultValues(this, R.xml.prefs, false);

    darkTheme = false;//from  w w w.  j  av a  2 s .  c om
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    if (prefs.getBoolean("darkTheme", false)) {
        setTheme(R.style.AppTheme_NoActionBar_Dark);
        darkTheme = true;
    }

    // Initiate activity
    super.onCreate(savedInstanceState);
    //setContentView(R.layout.activity_scrolling);
    appView = findViewById(R.id.viewApp);
    getLayoutInflater().inflate(R.layout.activity_scrolling, frameLayout);

    progressDialog = new ProgressDialog(WeatherActivity.this);

    // Load toolbar
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    if (darkTheme) {
        toolbar.setPopupTheme(R.style.AppTheme_PopupOverlay_Dark);
    }

    // Initialize textboxes
    todayTemperature = (TextView) findViewById(R.id.todayTemperature);
    todayDescription = (TextView) findViewById(R.id.todayDescription);
    todayWind = (TextView) findViewById(R.id.todayWind);
    todayPressure = (TextView) findViewById(R.id.todayPressure);
    todayHumidity = (TextView) findViewById(R.id.todayHumidity);
    //        todayIcon = (TextView) findViewById(R.id.todayIcon);
    topIcon = (TextView) findViewById(R.id.topIcon);
    bottomIcon = (TextView) findViewById(R.id.bottomIcon);
    hatIcon = (TextView) findViewById(R.id.hatIcon);
    shoeIcon = (TextView) findViewById(R.id.shoeIcon);

    weatherFont = Typeface.createFromAsset(this.getAssets(), "fonts/weather.ttf");
    clothFont = Typeface.createFromAsset(this.getAssets(), "fonts/cloth.ttf");
    //        todayIcon.setTypeface(weatherFont);
    topIcon.setTypeface(clothFont);
    bottomIcon.setTypeface(clothFont);
    shoeIcon.setTypeface(clothFont);
    hatIcon.setTypeface(clothFont);
    topIcon.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            scheduleAndWeatherFilter();
            Intent intent = new Intent(WeatherActivity.this, GalleryActivity.class);
            intent.putExtra("clothes", result.toArray());
            startActivity(intent);
        }
    });

    // Initialize viewPagerg
    viewPager = (ViewPager) findViewById(R.id.viewPager);
    tabLayout = (TabLayout) findViewById(R.id.tabs);

    destroyed = false;

    initMappings();

    // Preload data from cache
    preloadWeather();

    // Set autoupdater
    AlarmReceiver.setRecurringAlarm(this);
}

From source file:com.ccxt.whl.activity.AddContactActivity.java

/**
 * contact/* w  w  w.ja  v  a  2  s.co m*/
 * @param v
 */
public void searchContact(View v) {
    final String name = editText.getText().toString();
    String saveText = searchBtn.getText().toString();

    if (getString(R.string.button_search).equals(saveText)) {
        toAddUsername = name;
        if (TextUtils.isEmpty(name)) {
            startActivity(new Intent(this, AlertDialog.class).putExtra("msg", "??"));
            return;
        }

        RequestParams params = new RequestParams();
        params.add("email", toAddUsername);
        HttpRestClient.get(Constant.USER_URL_E, params, responseHandler);
        progressDialog = new ProgressDialog(this);
        progressDialog.setMessage("??...");
        progressDialog.setCanceledOnTouchOutside(false);
        progressDialog.show();
        // TODO ??contact,????
        //?
        searchedUserLayout.setVisibility(View.VISIBLE);
        nameText.setText(toAddUsername);

    }
}

From source file:com.pixmob.r2droid.SelectAccountActivity.java

@Override
protected Dialog onCreateDialog(int id) {
    if (AUTH_PENDING_DIALOG == id) {
        return new AlertDialog.Builder(this).setTitle(R.string.error).setMessage(R.string.auth_pending)
                .setIcon(R.drawable.alert_dialog_icon).create();
    }/*from   w  ww .j a v  a  2s . co  m*/
    if (AUTH_ERROR_DIALOG == id) {
        return new AlertDialog.Builder(this).setTitle(R.string.error).setMessage(R.string.auth_failed_error)
                .setIcon(R.drawable.alert_dialog_icon).create();
    }
    if (NETWORK_ERROR_DIALOG == id) {
        return new AlertDialog.Builder(this).setTitle(R.string.error).setMessage(R.string.network_error)
                .setIcon(R.drawable.alert_dialog_icon).create();
    }
    if (PROGRESS_DIALOG == id) {
        final ProgressDialog d = new ProgressDialog(this);
        d.setTitle(R.string.please_wait);
        d.setMessage(getString(R.string.checking_account));
        d.setOnCancelListener(new OnCancelListener() {
            @Override
            public void onCancel(DialogInterface dialog) {
                accountVerifier.cancel(true);
                accountVerifier = null;
            }
        });
        return d;
    }
    return super.onCreateDialog(id);
}

From source file:com.nbos.phonebook.sync.authenticator.AuthenticatorActivity.java

@Override
protected Dialog onCreateDialog(int id) {
    final ProgressDialog dialog = new ProgressDialog(this);
    dialog.setMessage(getText(R.string.ui_activity_authenticating));
    dialog.setIndeterminate(true);/* w  w w .java 2 s.co  m*/
    dialog.setCancelable(true);
    dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
        public void onCancel(DialogInterface dialog) {
            Log.i(tag, "dialog cancel has been invoked");
            if (mAuthThread != null) {
                mAuthThread.interrupt();
                finish();
            }
        }
    });
    return dialog;
}

From source file:com.pansapiens.occyd.NewPost.java

@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case DIALOG_POSTING: {
        ProgressDialog dialog = new ProgressDialog(this);
        dialog.setTitle("Posting ...");
        dialog.setMessage("Posting ...");
        dialog.setIndeterminate(true);//  ww  w.  j  a va  2s  .c  o  m
        dialog.setCancelable(false);
        return dialog;
    }
    }
    return null;
}