當前位置: 首頁>>代碼示例>>Java>>正文


Java ProgressDialog.dismiss方法代碼示例

本文整理匯總了Java中android.app.ProgressDialog.dismiss方法的典型用法代碼示例。如果您正苦於以下問題:Java ProgressDialog.dismiss方法的具體用法?Java ProgressDialog.dismiss怎麽用?Java ProgressDialog.dismiss使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.app.ProgressDialog的用法示例。


在下文中一共展示了ProgressDialog.dismiss方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: login

import android.app.ProgressDialog; //導入方法依賴的package包/類
@Override
public void login(@NonNull SmartLoginConfig config) {
    GoogleApiClient apiClient = config.getGoogleApiClient();
    Activity activity = config.getActivity();

    if (apiClient == null) {
        GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                .requestEmail()
                .requestProfile()
                .build();

        apiClient = new GoogleApiClient.Builder(activity)
                .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
                .build();
    }

    ProgressDialog progress = ProgressDialog.show(activity, "", activity.getString(R.string.logging_holder), true);
    Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(apiClient);
    activity.startActivityForResult(signInIntent, Constants.GOOGLE_LOGIN_REQUEST);
    progress.dismiss();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:22,代碼來源:GoogleLogin.java

示例2: onActivityResult

import android.app.ProgressDialog; //導入方法依賴的package包/類
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data, SmartLoginConfig config) {
    ProgressDialog progress = ProgressDialog.show(config.getActivity(), "", config.getActivity().getString(R.string.getting_data), true);
    GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
    Log.d("GOOGLE SIGN IN", "handleSignInResult:" + result.isSuccess());
    if (result.isSuccess()) {
        // Signed in successfully, show authenticated UI.
        GoogleSignInAccount acct = result.getSignInAccount();
        SmartGoogleUser googleUser = UserUtil.populateGoogleUser(acct);
        // Save the user
        UserSessionManager.setUserSession(config.getActivity(), googleUser);
        config.getCallback().onLoginSuccess(googleUser);
        progress.dismiss();
    } else {
        Log.d("GOOGLE SIGN IN", "" + requestCode);
        // Signed out, show unauthenticated UI.
        progress.dismiss();
        config.getCallback().onLoginFailure(new SmartLoginException("Google login failed", LoginType.Google));
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:21,代碼來源:GoogleLogin.java

示例3: showLoadingProgress

import android.app.ProgressDialog; //導入方法依賴的package包/類
@Override
public void showLoadingProgress(boolean show) {
	if (show) {
		alertDialog = new ProgressDialog(this);
		alertDialog.setMessage(getResources().getString(R.string.logging_in));
		alertDialog.setCancelable(false);
		alertDialog.show();
	}
	else {
		alertDialog.dismiss();
	}
}
 
開發者ID:stuxo,項目名稱:REDAndroid,代碼行數:13,代碼來源:LoginActivity.java

示例4: shareProtoFileDialog

import android.app.ProgressDialog; //導入方法依賴的package包/類
public static void shareProtoFileDialog(Context c, String folder, String name) {
    final ProgressDialog progress = new ProgressDialog(c);
    progress.setTitle("Exporting .proto");
    progress.setMessage("Your project will be ready soon!");
    progress.setCancelable(true);
    progress.setCanceledOnTouchOutside(false);
    progress.show();

    Project p = new Project(folder, name);
    String zipFilePath = exportProjectAsProtoFile(p);

    Intent shareIntent = new Intent();
    shareIntent.setAction(Intent.ACTION_SEND);
    shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(zipFilePath)));
    shareIntent.setType("application/zip");

    progress.dismiss();

    c.startActivity(Intent.createChooser(shareIntent, c.getResources().getText(R.string.share_phonk_file)));
}
 
開發者ID:victordiaz,項目名稱:phonk,代碼行數:21,代碼來源:PhonkScriptHelper.java

示例5: setupViewsForLogin

import android.app.ProgressDialog; //導入方法依賴的package包/類
private void setupViewsForLogin(boolean loading){
    btnLogin.setEnabled(!loading);
    if(loading) {
        mDialog = new ProgressDialog(this);
        mDialog.setIndeterminate(true);
        mDialog.setMessage(getString(R.string.text_loading_login));
        mDialog.show();
    }else if(mDialog.isShowing()){
        mDialog.dismiss();
    }

}
 
開發者ID:Bruno125,項目名稱:Unofficial-Ups,代碼行數:13,代碼來源:LoginActivity.java

示例6: onPostExecuteMain

import android.app.ProgressDialog; //導入方法依賴的package包/類
@Override
public final void onPostExecuteMain() {
    ProgressDialog progressDialog = weakProgressDialog.get();
    if (progressDialog != null) {
        try {
            progressDialog.dismiss();
        } catch (Throwable ignored) {
        }
        onProgressClosed();
    }
}
 
開發者ID:solkin,項目名稱:minion-android,代碼行數:12,代碼來源:PleaseWaitTask.java

示例7: onNewIntent

import android.app.ProgressDialog; //導入方法依賴的package包/類
@Override
protected void onNewIntent(Intent intent) {
    if (canResult != null) {
        if(DniDialog.getInstance() != null){
            DniDialog.getInstance().dismiss();
        }
        final Tag discoveredTag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
        Log.d("com.mifirma", "Tag: " + discoveredTag);

        final ProgressDialog progDailog = new ProgressDialog(MainActivity.this);
        progDailog.setMessage(this.getResources().getString(R.string.loadingNFC));
        progDailog.setIndeterminate(false);
        progDailog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        progDailog.setCancelable(false);
        progDailog.show();

        try {
            // Ejecutamos la tarea de firma
            new KeyStoreLoadTask(
                this,
                canResult,
                progDailog
            ).execute(discoveredTag);
        }
        catch (final Throwable e){
            if(DniDialog.getInstance() != null){
                DniDialog.getInstance().dismiss();
            }
            progDailog.dismiss();
            canResult = null;
            Log.w("com.mifirma", "Error inicializando DNIe NFC: " + e);
            Toast.makeText(this, "Ha sido imposible usar el DNI NFC, inténtelo de nuevo.", Toast.LENGTH_LONG).show();
        }

    }
}
 
開發者ID:MiFirma,項目名稱:mi-firma-android,代碼行數:37,代碼來源:MainActivity.java

示例8: removeFavorite

import android.app.ProgressDialog; //導入方法依賴的package包/類
/**
 * Removes a favorite from the records and deletes its data
 * @param favoriteName entry to remove
 * @param mContext context to get the settings
 */
public static void removeFavorite(String favoriteName, Context mContext) {
    ProgressDialog dialog = ProgressDialog.show(mContext, "",
            "Processing", true);
    dialog.show();

    String path = Environment.getExternalStorageDirectory().getAbsolutePath()
            + "/" + mContext.getResources().getString(R.string.app_name)
            + "/" + favoriteName;

    final File file = new File(path);

    if (!deleteDirectory(file)) {
        Toast.makeText(mContext, "Unable to delete folder", Toast.LENGTH_LONG).show();
        dialog.dismiss();
        return;
    }

    SharedPreferences settings = mContext.getSharedPreferences(
            mContext.getResources().getString(R.string.app_name),
            Context.MODE_PRIVATE);

    if (!settings.contains(favoriteName)) {
        Log.e("REMOVE", "Entry was not found for folder");
        dialog.dismiss();
        return;
    }

    SharedPreferences.Editor editor = settings.edit();
    editor.remove(favoriteName);
    editor.apply();
    dialog.dismiss();
}
 
開發者ID:feup-infolab,項目名稱:labtablet,代碼行數:38,代碼來源:FileMgr.java

示例9: getAPI

import android.app.ProgressDialog; //導入方法依賴的package包/類
public void getAPI(){
    humansaid = messageET.getText().toString();
    jsonURL = "https://monigarr-monigarr-bots-v1.p.mashape.com/conversation_start.php?bot_id=1&say=" +humansaid+ "&format=json";

    final ProgressDialog pDialog = new ProgressDialog(ParseJSONObject.this);
    pDialog.setMessage("Loading...");
    pDialog.show();

    JsonObjectRequest jsonObjReq =
            new JsonObjectRequest(Method.GET,jsonURL, null,new Response.Listener<JSONObject>() {

                @Override
                public void onResponse(JSONObject response) {
                    mBotResponse = JSONParser.parseFeed(response);
                    yousaidTextView.setText("You Said :" + mBotResponse.getYouSaid());
                    botsaidTextView.setText("Bot Said :" + mBotResponse.getBotSaid());
                    Log.d(TAG, response.toString());
                    pDialog.dismiss();
                }
            }, new Response.ErrorListener() {

                @Override
                public void onErrorResponse(VolleyError error) {
                    VolleyLog.d(TAG, "Error: " + error.getMessage());
                    pDialog.hide();
                }
            }) {
                @Override
                public Map<String, String> getHeaders() throws AuthFailureError {
                    Map<String, String>  params = new HashMap<>();
                    params.put("X-Mashape-Key", developerkey);
                    params.put("Accept", "text/plain");
                    return params;
                }
            };

    Volley.newRequestQueue(getApplicationContext()).add(jsonObjReq);
}
 
開發者ID:monigarr,項目名稱:AIBotAPI,代碼行數:39,代碼來源:ParseJSONObject.java

示例10: toggleProgressBarVisibility

import android.app.ProgressDialog; //導入方法依賴的package包/類
public Runnable toggleProgressBarVisibility(final ProgressDialog progressDialog) {
    return new Runnable() {
        @Override
        public void run() {
            if(progressDialog!=null) {
                progressDialog.dismiss();
            }
        }
    };
}
 
開發者ID:adityak368,項目名稱:Android-FileBrowser-FilePicker,代碼行數:11,代碼來源:UIUpdateHelper.java

示例11: onPostExecute

import android.app.ProgressDialog; //導入方法依賴的package包/類
@Override
protected void onPostExecute(Object object) {
    super.onPostExecute(object);
    if (mProgressDialogWeakReference != null) {
        ProgressDialog progressDialog = mProgressDialogWeakReference.get();
        if (progressDialog != null) {
            progressDialog.dismiss();
        }
    }
    CourseFragment fragment = mCourseFragmentWeakReference.get();
    if (fragment != null) {
        fragment.startCourseDetail(object);
    }
}
 
開發者ID:kamisakihideyoshi,項目名稱:TaipeiTechRefined,代碼行數:15,代碼來源:CourseDetailTask.java

示例12: onPostExecute

import android.app.ProgressDialog; //導入方法依賴的package包/類
@Override
protected void onPostExecute(Object object) {
    super.onPostExecute(object);
    ProgressDialog progressDialog = mProgressDialogWeakReference.get();
    if (progressDialog != null) {
        progressDialog.dismiss();
    }
    CourseFragment fragment = mCourseFragmentWeakReference.get();
    if (fragment != null) {
        fragment.obtainStudentCourse(object);
    }
}
 
開發者ID:kamisakihideyoshi,項目名稱:TaipeiTechRefined,代碼行數:13,代碼來源:SearchCourseTask.java

示例13: onPostExecute

import android.app.ProgressDialog; //導入方法依賴的package包/類
@Override
protected void onPostExecute(Object object) {
    super.onPostExecute(object);
    ProgressDialog progressDialog = mProgressDialogWeakReference.get();
    if (progressDialog != null) {
        progressDialog.dismiss();
    }
    CourseFragment fragment = mCourseFragmentWeakReference.get();
    if (fragment != null) {
        fragment.obtainSemesterList(object);
    }
}
 
開發者ID:kamisakihideyoshi,項目名稱:TaipeiTechRefined,代碼行數:13,代碼來源:QuerySemesterTask.java

示例14: RunAndGetDeterminantWithAdjoint

import android.app.ProgressDialog; //導入方法依賴的package包/類
public void RunAndGetDeterminantWithAdjoint(final int i, final ProgressDialog progressDialog) {
    Runnable runnable = new Runnable() {
        @Override
        public void run() {
            Message message = new Message();
            Bundle bundle = new Bundle();
            float detr = (float) SquareList.get(i).GetDeterminant(progressDialog);
            if (detr == 0.0f) {
                myHandler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(getContext(), R.string.NoInverse, Toast.LENGTH_SHORT).show();
                    }
                }, 0);
                progressDialog.dismiss();
            } else {
                progressDialog.setProgress(0);
                bundle.putFloat("DETERMINANT", detr);
                Matrix res = SquareList.get(i).ReturnAdjoint(progressDialog);
                bundle.putAll(res.GetDataBundled());
                message.setData(bundle);
                myHandler.sendMessage(message);
            }

        }
    };
    Thread thread = new Thread(runnable);
    thread.start();
}
 
開發者ID:coder3101,項目名稱:Matrix-Calculator-for-Android,代碼行數:30,代碼來源:InverseFragment.java

示例15: dismissAppProgressBar

import android.app.ProgressDialog; //導入方法依賴的package包/類
public static void dismissAppProgressBar(ProgressDialog progressDialog) {
    if (progressDialog != null)
        progressDialog.dismiss();
}
 
開發者ID:gaolhjy,項目名稱:cniao5,代碼行數:5,代碼來源:UIHelper.java


注:本文中的android.app.ProgressDialog.dismiss方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。