本文整理汇总了Java中org.thoughtcrime.securesms.util.Dialogs.showAlertDialog方法的典型用法代码示例。如果您正苦于以下问题:Java Dialogs.showAlertDialog方法的具体用法?Java Dialogs.showAlertDialog怎么用?Java Dialogs.showAlertDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.thoughtcrime.securesms.util.Dialogs
的用法示例。
在下文中一共展示了Dialogs.showAlertDialog方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleDial
import org.thoughtcrime.securesms.util.Dialogs; //导入方法依赖的package包/类
private void handleDial(final Recipient recipient) {
if (recipient == null) return;
if (isSecureText) {
Intent intent = new Intent(this, WebRtcCallService.class);
intent.setAction(WebRtcCallService.ACTION_OUTGOING_CALL);
intent.putExtra(WebRtcCallService.EXTRA_REMOTE_NUMBER, recipient.getNumber());
startService(intent);
Intent activityIntent = new Intent(this, WebRtcCallActivity.class);
activityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(activityIntent);
} else {
try {
Intent dialIntent = new Intent(Intent.ACTION_DIAL,
Uri.parse("tel:" + recipient.getNumber()));
startActivity(dialIntent);
} catch (ActivityNotFoundException anfe) {
Log.w(TAG, anfe);
Dialogs.showAlertDialog(this,
getString(R.string.ConversationActivity_calls_not_supported),
getString(R.string.ConversationActivity_this_device_does_not_appear_to_support_dial_actions));
}
}
}
示例2: onActivityResult
import org.thoughtcrime.securesms.util.Dialogs; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if ((scanResult != null) && (scanResult.getContents() != null)) {
String data = scanResult.getContents();
if (data.equals(Base64.encodeBytes(getIdentityKeyToCompare().serialize()))) {
Dialogs.showInfoDialog(this, getVerifiedTitle(), getVerifiedMessage());
} else {
Dialogs.showAlertDialog(this, getNotVerifiedTitle(), getNotVerifiedMessage());
}
} else {
Toast.makeText(this, R.string.KeyScanningActivity_no_scanned_key_found_exclamation,
Toast.LENGTH_LONG).show();
}
}
示例3: onClick
import org.thoughtcrime.securesms.util.Dialogs; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
final RegistrationActivity self = RegistrationActivity.this;
if (TextUtils.isEmpty(countryCode.getText())) {
Toast.makeText(self,
getString(R.string.RegistrationActivity_you_must_specify_your_country_code),
Toast.LENGTH_LONG).show();
return;
}
if (TextUtils.isEmpty(number.getText())) {
Toast.makeText(self,
getString(R.string.RegistrationActivity_you_must_specify_your_phone_number),
Toast.LENGTH_LONG).show();
return;
}
final String e164number = getConfiguredE164Number();
if (!PhoneNumberFormatter.isValidNumber(e164number)) {
Dialogs.showAlertDialog(self,
getString(R.string.RegistrationActivity_invalid_number),
String.format(getString(R.string.RegistrationActivity_the_number_you_specified_s_is_invalid),
e164number));
return;
}
promptForRegistrationStart(self, e164number, false);
}
示例4: handleDial
import org.thoughtcrime.securesms.util.Dialogs; //导入方法依赖的package包/类
private void handleDial(Recipient recipient) {
try {
if (recipient == null) return;
Intent dialIntent = new Intent(Intent.ACTION_DIAL,
Uri.parse("tel:" + recipient.getNumber()));
startActivity(dialIntent);
} catch (ActivityNotFoundException anfe) {
Log.w(TAG, anfe);
Dialogs.showAlertDialog(this,
getString(R.string.ConversationActivity_calls_not_supported),
getString(R.string.ConversationActivity_this_device_does_not_appear_to_support_dial_actions));
}
}
示例5: handleMultiRegistrationError
import org.thoughtcrime.securesms.util.Dialogs; //导入方法依赖的package包/类
private void handleMultiRegistrationError(RegistrationState state) {
handleVerificationTimeout(state);
Dialogs.showAlertDialog(this, getString(R.string.RegistrationProgressActivity_registration_conflict),
getString(R.string.RegistrationProgressActivity_this_number_is_already_registered_on_a_different));
}
示例6: onClick
import org.thoughtcrime.securesms.util.Dialogs; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
final RegistrationActivity self = RegistrationActivity.this;
if (TextUtils.isEmpty(countryCode.getText())) {
Toast.makeText(self,
getString(R.string.RegistrationActivity_you_must_specify_your_country_code),
Toast.LENGTH_LONG).show();
return;
}
if (TextUtils.isEmpty(number.getText())) {
Toast.makeText(self,
getString(R.string.RegistrationActivity_you_must_specify_your_phone_number),
Toast.LENGTH_LONG).show();
return;
}
final String e164number = getConfiguredE164Number();
if (!PhoneNumberFormatter.isValidNumber(e164number)) {
Dialogs.showAlertDialog(self,
getString(R.string.RegistrationActivity_invalid_number),
String.format(getString(R.string.RegistrationActivity_the_number_you_specified_s_is_invalid),
e164number));
return;
}
PlayServicesStatus gcmStatus = checkPlayServices(self);
if (gcmStatus == PlayServicesStatus.SUCCESS) {
promptForRegistrationStart(self, e164number, true);
} else if (gcmStatus == PlayServicesStatus.MISSING) {
promptForNoPlayServices(self, e164number);
} else if (gcmStatus == PlayServicesStatus.NEEDS_UPDATE) {
GoogleApiAvailability.getInstance().getErrorDialog(self, ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED, 0).show();
} else {
Dialogs.showAlertDialog(self, getString(R.string.RegistrationActivity_play_services_error),
getString(R.string.RegistrationActivity_google_play_services_is_updating_or_unavailable));
}
}