本文整理汇总了Java中android.app.Activity.isRestricted方法的典型用法代码示例。如果您正苦于以下问题:Java Activity.isRestricted方法的具体用法?Java Activity.isRestricted怎么用?Java Activity.isRestricted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.Activity
的用法示例。
在下文中一共展示了Activity.isRestricted方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showDialog
import android.app.Activity; //导入方法依赖的package包/类
public static void showDialog(Activity context, CharSequence title, CharSequence centerText, OnClickListener centerListener) {
if (mCommonDialog != null && mCommonDialog.isShowing()) {
mCommonDialog.dismiss();
}
mCommonDialog = new LetvCommonDialog(context);
mCommonDialog.setTitle(title);
mCommonDialog.setButtonText(centerText);
if (centerListener != null) {
mCommonDialog.setCenterOnClickListener(centerListener);
}
if (!context.isFinishing() && !context.isRestricted()) {
try {
mCommonDialog.show();
} catch (Exception e) {
}
}
}
示例2: callDialogMsgPositiveButton
import android.app.Activity; //导入方法依赖的package包/类
public static void callDialogMsgPositiveButton(Activity activity, String msgId, OnClickListener yes) {
TipBean dialogMsgByMsg = TipUtils.getTipBean(msgId);
if (activity != null && dialogMsgByMsg != null) {
CharSequence string;
Builder builder = new Builder(activity);
if ("".equals(dialogMsgByMsg.title) || dialogMsgByMsg.title == null) {
string = activity.getString(2131100003);
} else {
string = dialogMsgByMsg.title;
}
Dialog dialog = builder.setTitle(string).setIcon(2130837921).setMessage(dialogMsgByMsg.message).setPositiveButton(2131100002, yes).create();
if (!activity.isFinishing() && !activity.isRestricted()) {
try {
dialog.show();
} catch (Exception e) {
}
}
}
}
示例3: showDialog
import android.app.Activity; //导入方法依赖的package包/类
public static void showDialog(Activity context, CharSequence title, CharSequence content, CharSequence leftText, CharSequence rightText, OnClickListener leftListener, OnClickListener rightListener, int layoutId) {
if (mCommonDialog != null && mCommonDialog.isShowing()) {
mCommonDialog.dismiss();
}
mCommonDialog = new CommonDialog(context, layoutId);
mCommonDialog.setTitle(title);
mCommonDialog.setContent(content.toString());
mCommonDialog.setButtonText(leftText, rightText);
if (leftListener != null) {
mCommonDialog.setLeftOnClickListener(leftListener);
}
if (rightListener != null) {
mCommonDialog.setRightOnClickListener(rightListener);
}
if (!context.isFinishing() && !context.isRestricted()) {
mCommonDialog.show();
}
}
示例4: call
import android.app.Activity; //导入方法依赖的package包/类
public static void call(Activity activity, int titleId, int messageId, OnClickListener yes, OnClickListener no) {
if (activity != null) {
try {
Dialog dialog = new Builder(activity).setTitle(titleId).setIcon(R.drawable.dialog_icon).setMessage(messageId).setPositiveButton(R.string.dialog_default_ok, yes).setNegativeButton(R.string.dialog_default_no, no).create();
if (!activity.isFinishing() && !activity.isRestricted()) {
dialog.show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例5: call
import android.app.Activity; //导入方法依赖的package包/类
public static void call(Activity activity, int messageId, int yes, int no, OnClickListener yesListener, OnClickListener noListener) {
if (activity != null) {
Dialog dialog = new Builder(activity).setTitle(R.string.dialog_default_title).setIcon(R.drawable.dialog_icon).setMessage(messageId).setPositiveButton(yes, yesListener).setNegativeButton(no, noListener).create();
if (!activity.isFinishing() && !activity.isRestricted()) {
try {
dialog.show();
} catch (Exception e) {
}
}
}
}
示例6: showDialog
import android.app.Activity; //导入方法依赖的package包/类
public static void showDialog(Activity context, String strTitle, String strText, int icon) {
if (context != null && !context.isFinishing() && !context.isRestricted()) {
Builder tDialog = new Builder(context);
tDialog.setIcon(icon);
tDialog.setTitle(strTitle);
tDialog.setMessage(strText);
tDialog.setPositiveButton(R.string.Ensure, null);
try {
tDialog.show();
} catch (Exception e) {
}
}
}
示例7: call
import android.app.Activity; //导入方法依赖的package包/类
public static void call(Activity activity, int messageId, int yes, int no, OnClickListener yesListener, OnClickListener noListener, View view) {
if (activity != null) {
Dialog dialog = new Builder(activity).setTitle(2131100003).setIcon(2130837921).setMessage(messageId).setView(view).setPositiveButton(yes, yesListener).setNegativeButton(no, noListener).create();
if (!activity.isFinishing() && !activity.isRestricted()) {
try {
dialog.show();
} catch (Exception e) {
}
}
}
}