本文整理汇总了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();
}
示例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));
}
}
示例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();
}
}
示例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)));
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
}
示例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();
}
示例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);
}
示例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();
}
}
};
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例15: dismissAppProgressBar
import android.app.ProgressDialog; //导入方法依赖的package包/类
public static void dismissAppProgressBar(ProgressDialog progressDialog) {
if (progressDialog != null)
progressDialog.dismiss();
}