本文整理匯總了Java中org.telegram.ui.PhotoViewer.showAlertDialog方法的典型用法代碼示例。如果您正苦於以下問題:Java PhotoViewer.showAlertDialog方法的具體用法?Java PhotoViewer.showAlertDialog怎麽用?Java PhotoViewer.showAlertDialog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.telegram.ui.PhotoViewer
的用法示例。
在下文中一共展示了PhotoViewer.showAlertDialog方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: maybeShowDismissalAlert
import org.telegram.ui.PhotoViewer; //導入方法依賴的package包/類
public void maybeShowDismissalAlert(PhotoViewer photoViewer, Activity parentActivity, final Runnable okRunnable) {
if (editingText) {
closeTextEnter(false);
return;
} else if (pickingSticker) {
closeStickersView();
return;
}
if (hasChanges()) {
if (parentActivity == null) {
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setMessage(LocaleController.getString("DiscardChanges", R.string.DiscardChanges));
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
okRunnable.run();
}
});
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
photoViewer.showAlertDialog(builder);
} else {
okRunnable.run();
}
}