/** * @param resId * @return * @see android.content.Context#getText(int) */ public final CharSequence getText(int resId) { return mActivity.getText(resId); }
// Called when "Set as" is clicked. private static boolean onSetAsClicked(MenuInvoker onInvoke, final Activity activity) { onInvoke.run(new MenuCallback() { public void run(Uri u, IImage image) { if (u == null || image == null) { return; } Intent intent = Util.createSetAsIntent(image); activity.startActivity(Intent.createChooser(intent, activity.getText(R.string.setImage))); } }); return true; }
/** */ @NonNull @Override public CharSequence getText(@StringRes int resId) { return mActivity.getText(resId); }
/** */ @NonNull @Override public CharSequence getText(@StringRes int resId) { return mActivity.getText(resId); }
/** * Set the title that will be used for the activity chooser for this share. * * @param resId Resource ID of the title string to use * @return This IntentBuilder for method chaining */ public IntentBuilder setChooserTitle(int resId) { return setChooserTitle(mActivity.getText(resId)); }
/** * @param msg * @return */ public FastLoadDialog setMessage(int msg) { mActivity = mReference.get(); if (mActivity != null) { return setMessage(mActivity.getText(msg)); } return this; }
/** * Create an non-cancellable alert dialog builder. */ @CheckResult public static Builder buildAlert(final Activity activity, final @StringRes int title, final @StringRes int message) { return buildAlert(activity, title != 0 ? activity.getText(title) : null, message != 0 ? activity.getText(message) : null); }
/** * Set the title that will be used for the activity chooser for this share. * * @param resId Resource ID of the title string to use * @return This IntentBuilder for method chaining */ public IntentBuilder setChooserTitle(@StringRes int resId) { return setChooserTitle(mActivity.getText(resId)); }
@NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { Activity activity = getActivity(); AlertDialog.Builder builder = new AlertDialog.Builder(activity, getTheme()); if (mTitle != null) { builder.setTitle(mTitle); } if (mMessage != null) { builder.setMessage(mMessage); } CharSequence positiveButtonText = mPositiveButtonText; if (positiveButtonText == null) { positiveButtonText = activity.getText(android.R.string.ok); } builder.setPositiveButton(positiveButtonText, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { openAppDetails(); } }); if (mNegativeButtonText != null) { builder.setNegativeButton(mNegativeButtonText, null); } builder.setCancelable(mCancelable); return builder.create(); }
public static void showLabel(Activity activity, @IdRes int viewId, @StringRes int stringResId) { showText(activity.findViewById(viewId), activity.getText(stringResId).toString(), TextMediaType.UNKNOWN, false, false); }
mProgressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, activity.getText(android.R.string.cancel), new DialogInterface.OnClickListener() { @Override
@Override protected boolean onItemSelected(MenuItem item) { Activity activity = (Activity) mActivity; if (item.getItemId() == R.id.action_cancel) { activity.setResult(Activity.RESULT_CANCELED); activity.finish(); return true; } else if (item.getItemId() == R.id.action_details) { if (mAlbumSetDataAdapter.size() != 0) { if (mShowDetails) { hideDetails(); } else { showDetails(); } } else { Toast.makeText(activity, activity.getText(R.string.no_albums_alert), Toast.LENGTH_SHORT).show(); } return true; } else { return false; } }
private void syncUpgrade() { boolean success = false; try { progressLogger.logProgress(upgradeRequestor.getText(R.string.label_upgrading)); success = doUpgrade(); } finally { progressLogger.onComplete(success); } }
intent = Intent.createChooser(intent, getActivity().getText(R.string.share_via)); if(Utils.isIntentAvailable(getActivity(), intent)) { startActivity(intent);
? "Location-based tracking was switched on already and is still enabled." : "You can now enable location-based tracking, just check \"" + reference.getText(R.string.enableLocationBasedTracking) + "\"."), null); reference.startActivity(messageIntent);