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.shanet.relayremote.Background.java

public Background(Context context, final char op, boolean isWidget) {
    this.context = context;
    this.op = op;
    this.isWidget = isWidget;

    // If a widget, don't show any dialogs
    if (isWidget)
        return;//  w  w  w.  j a va2s  .c o m

    dialog = new ProgressDialog(context);

    // Show a dialog if the bg thread runs longer than the time specified in onPreExecute() below
    timer = new Timer();
    tt = new TimerTask() {
        @Override
        public void run() {
            Looper.prepare();
            ((Activity) Background.this.context).runOnUiThread(new Runnable() {
                public void run() {
                    dialog = ProgressDialog.show(Background.this.context, "", Background.this.context.getString(
                            (op == Constants.OP_SET) ? R.string.connServer : R.string.gettingStates));
                }
            });
        }
    };
}

From source file:com.meycup.ducksound.BackgroundSearch.java

BackgroundSearch(Context context, ListView listView, Toolbar play_bar, TextView tv) {
    this.context = context;
    this.listView = listView;
    this.play_bar = play_bar;
    this.tv = tv;

    progress = new ProgressDialog(context);
}

From source file:thiru.in.basicauthwebview.Authenticate.java

@Override
protected void onPreExecute() {
    super.onPreExecute();
    progDailog = new ProgressDialog(this.context);
    progDailog.setMessage("Loading...");
    progDailog.setIndeterminate(false);/*from www .  j  a v  a 2  s.c  o  m*/
    progDailog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    progDailog.setCancelable(true);
    Log.i("OnPreExecute", "Show");
    progDailog.show();
}

From source file:com.peopleapi.RegisterWithApi.java

@Override
protected void onPreExecute() {
    pDialog = new ProgressDialog(context);
    pDialog.setMessage("Creating user...");
    pDialog.setIndeterminate(true);/*from   w w w.  j a  v a  2s  .  co  m*/
    pDialog.setCancelable(false);
    pDialog.show();
}

From source file:com.yoavst.quickapps.news.LoginActivity.java

@AfterInject
void init() {/*from  ww  w  .j a  v  a  2s . c  o m*/
    String url = mManager.getService().getAuthorizationUrl(EMPTY_TOKEN);
    mProgressDialog = new ProgressDialog(this);
    mProgressDialog.setMessage(getString(R.string.loading));
    WebView webView = createWebView(this);
    setContentView(webView);
    webView.loadUrl(url);
}

From source file:edu.usf.cutr.opentripplanner.android.tasks.MetadataRequest.java

public MetadataRequest(WeakReference<Activity> activity, Context context,
        MetadataRequestCompleteListener callback) {
    this.activity = activity;
    this.context = context;
    this.callback = callback;
    Activity activityRetrieved = activity.get();
    if (activityRetrieved != null) {
        progressDialog = new ProgressDialog(activityRetrieved);
    }/*from ww  w  .  j a v  a 2  s .  co m*/
}

From source file:com.securekey.sdk.sample.AuthenticateDeviceActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    SDKSampleApp.getInstance().setCurrentActivity(this);
    me = this;/*from ww  w.  j  a v a  2  s  .co  m*/
    setContentView(R.layout.activity_authenticate);

    mProgressDialog = new ProgressDialog(this);

    findViewById(R.id.buttonAuthenticateDeviceReturnJWS).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {

            authenticateDeviceAndReturnJWS();
        }
    });

    findViewById(R.id.buttonAuthenticateDevice).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {

            authenticateDevice();
        }
    });

}

From source file:com.hua.goddess.activites.RegisterActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_register);
    pd = new ProgressDialog(RegisterActivity.this);
    // DeviceUuidFactory uuid = new DeviceUuidFactory(this);
    // uid = uuid.getDeviceUuid().toString();

    emailEditText = (EditText) findViewById(R.id.email);
    emailEditText.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);// ??
    userNameEditText = (EditText) findViewById(R.id.username);
    passwordEditText = (EditText) findViewById(R.id.password);
    confirmPwdEditText = (EditText) findViewById(R.id.confirm_password);

    rg = (RadioGroup) findViewById(R.id.sex);
    b1 = (RadioButton) findViewById(R.id.male);
    b2 = (RadioButton) findViewById(R.id.female);
    wh = new WsRequestHelper(new WsRequestHelper.InterfaceCallBack() {
        @Override/*from  www .ja  va  2  s. c  o  m*/
        public void RequestCallBack(Object result) {
            // TODO Auto-generated method stub
            pd.dismiss();
            // Toast.makeText(RegisterActivity.this, result.toString(),
            // Toast.LENGTH_SHORT).show();
            if (result.toString().equals("?")) {
                Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);
                Bundle bundle = new Bundle();
                bundle.putString("username", userNameEditText.getText().toString().trim());

                intent.putExtras(bundle);
                setResult(100, intent);
                finish();
            }

        }
    });

    rg.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            // TODO Auto-generated method stub
            if (checkedId == b1.getId()) {
                sex = "1";
                Toast.makeText(RegisterActivity.this, "", Toast.LENGTH_LONG).show();
            }
            if (checkedId == b2.getId()) {
                sex = "2";
                Toast.makeText(RegisterActivity.this, "", Toast.LENGTH_LONG).show();
            }

        }

    });
}

From source file:com.dedipower.portal.android.Launcher.java

/** Called when the activity is first created. */
@Override/*from   www  .j  a  v  a  2  s .c  om*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.launcher);

    dialog = new ProgressDialog(this);
    dialog.setMessage("Logging in.....");

    //Get our settings
    settings = getSharedPreferences("Dedipower", 0);
    ManageSettings();

    handler = new Handler() {
        public void handleMessage(Message msg) {
            dialog.dismiss();
            //Apparantly stopping threads is no longer supported
            //peformLogin.stop();

            if (APIResponse == "true") {
                //Tell the user
                Toast.makeText(Launcher.this, "Login Successful", Toast.LENGTH_SHORT).show();

                //Check the "remember details checkbox"
                CheckBox Remember = (CheckBox) findViewById(R.id.RememberDetailsCheckBox);

                SharedPreferences.Editor editor = settings.edit();
                if (Remember.isChecked() == true) {
                    editor.putString("AcctCode", AcctCode);
                    editor.putString("Email", Email);
                    editor.putString("Password", Password);
                    editor.putBoolean("Remember", true);
                    editor.commit();
                } else {
                    editor.putString("AcctCode", "");
                    editor.putString("Email", "");
                    editor.putString("Password", "");
                    editor.putBoolean("Remember", false);
                    editor.commit();
                }

                //Do extent stuff
                Intent LauncherIntent = new Intent(Launcher.this, PortalLanding.class);
                LauncherIntent.putExtra("sessionid", API.SessionID);
                Launcher.this.startActivity(LauncherIntent);
                finish();
            } else {
                Toast.makeText(Launcher.this, "Login Failed: " + APIResponse, Toast.LENGTH_SHORT).show();
            }
        }
    };

    Button LoginButton = (Button) findViewById(R.id.LoginButton);
    LoginButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            dialog.show();
            EditText AcctCodeEditText = (EditText) findViewById(R.id.AcctCodeInput);
            EditText EmailEditText = (EditText) findViewById(R.id.EmailInput);
            EditText PasswordEditText = (EditText) findViewById(R.id.PasswordInput);
            AcctCode = AcctCodeEditText.getText().toString();
            Email = EmailEditText.getText().toString();
            Password = PasswordEditText.getText().toString();

            Credentials.add(new BasicNameValuePair("account", AcctCode));
            Credentials.add(new BasicNameValuePair("username", Email));
            Credentials.add(new BasicNameValuePair("password", Password));
            CreateThread();
            peformLogin.start();

            /*String APIResponse = API.Login(Credentials);
            if(APIResponse == "true")
            {
              //Tell the user
              Toast.makeText(Launcher.this, "Login Successful", Toast.LENGTH_SHORT).show();
                      
              //Check the "remember details checkbox"
              CheckBox Remember = (CheckBox) findViewById(R.id.RememberDetailsCheckBox);
                      
              SharedPreferences.Editor editor = settings.edit();
              if(Remember.isChecked() == true)
              {
                editor.putString("AcctCode", AcctCodeEditText.getText().toString());
                editor.putString("Email", EmailEditText.getText().toString());
                editor.putString("Password", PasswordEditText.getText().toString());
                editor.putBoolean("Remember", true);
                editor.commit();
              }
              else
              {
                editor.putString("AcctCode", "");
                editor.putString("Email", "");
                editor.putString("Password", "");
                editor.putBoolean("Remember", false);
                editor.commit();
              }
                      
              //Do extent stuff
              Intent LauncherIntent = new Intent(Launcher.this, PortalLanding.class);
              LauncherIntent.putExtra("sessionid", API.SessionID);
              Launcher.this.startActivity(LauncherIntent);
              finish();
            }
            else
            {
              Toast.makeText(Launcher.this, "Login Failed: " + APIResponse, Toast.LENGTH_SHORT).show();
            }*/
        }
    });
}

From source file:com.orange.labs.sample.UploadPicture.java

public UploadPicture(Context context, OrangeCloudAPI<?> api, OrangeCloudAPI.Entry entry, File file) {
    mContext = context;/*from  w w w.  ja  v a  2  s. co m*/
    mApi = api;
    mEntry = entry;
    mFile = file;

    mDialog = new ProgressDialog(context);
    mDialog.setMax(100);
    mDialog.setMessage(mContext.getResources().getString(R.string.upload_image_title) + file.getName());
    mDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    mDialog.setProgress(0);
    mDialog.show();
}