本文整理了Java中android.support.v7.app.AppCompatActivity.isFinishing()
方法的一些代码示例,展示了AppCompatActivity.isFinishing()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppCompatActivity.isFinishing()
方法的具体详情如下:
包路径:android.support.v7.app.AppCompatActivity
类名称:AppCompatActivity
方法名:isFinishing
暂无
代码示例来源:origin: JingYeoh/FragmentRigger
@Override
public void onDestroy() {
mStackManager.onDestroy();
if (mActivity.isFinishing()) {
mStackManager.clear();
if (mRiggerTransaction != null) {
mRiggerTransaction.removeAll();
}
}
}
代码示例来源:origin: BoBoMEe/Android-Demos
public static BottomDialogFragment showDialog(AppCompatActivity appCompatActivity) {
FragmentManager fragmentManager = appCompatActivity.getSupportFragmentManager();
BottomDialogFragment bottomDialogFragment =
(BottomDialogFragment) fragmentManager.findFragmentByTag(TAG);
if (null == bottomDialogFragment) {
bottomDialogFragment = newInstance();
}
if (!appCompatActivity.isFinishing()
&& null != bottomDialogFragment
&& !bottomDialogFragment.isAdded()) {
fragmentManager.beginTransaction()
.add(bottomDialogFragment, TAG)
.commitAllowingStateLoss();
}
return bottomDialogFragment;
}
}
代码示例来源:origin: materialos/android-icon-pack
public static boolean check(@NonNull AppCompatActivity context, @NonNull LicensingCallback cb) {
final String key = Config.get().licensingPublicKey();
if (key == null || key.trim().isEmpty()) {
LOG("License checking is disabled.");
return true;
} else if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean(KEY_VALID, false)) {
LOG("License checking has already been done, and the license check was successful.");
return true;
}
if (BuildConfig.DEBUG) {
Toast.makeText(context, "License checking is disabled for this debug build.", Toast.LENGTH_SHORT).show();
return true;
}
if (context.getContentResolver() == null) {
if (!context.isFinishing())
context.finish();
return false;
}
mProgress = ProgressDialogFragment.show(context, R.string.checking_license);
final String deviceId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
// Library calls this when it's done.
mLicenseCheckerCallback = new MyLicenseCheckerCallback(context, cb);
// Construct the LicenseChecker with a policy.
mChecker = new LicenseChecker(
context, new ServerManagedPolicy(context,
new AESObfuscator(getSalt(context), BuildConfig.APPLICATION_ID, deviceId)),
key);
mChecker.checkAccess(mLicenseCheckerCallback);
return false;
}
代码示例来源:origin: MFlisar/GDPRDialog
protected void onPostExecute(GDPRPreperationData result) {
if (isCancelled()) {
return;
}
T activity = mActivity.get();
if (activity != null && !activity.isFinishing()) {
if (mSetup.requestLocationChecks().length > 0 && result.getLocation() == GDPRLocation.NOT_IN_EAA) {
// user does want to not request consent and consider this as consent given, so we save this here
GDPRConsentState consentState = new GDPRConsentState(activity, GDPRConsent.AUTOMATIC_PERSONAL_CONSENT, result.getLocation());
GDPR.getInstance().setConsent(consentState);
activity.onConsentInfoUpdate(consentState, true);
} else {
activity.onConsentNeedsToBeRequested(result);
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!