本文整理匯總了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) {
}
}
}
}