use of android.app.AlertDialog.Builder in project scdl by passy.
the class SoundcloudInstallAsker method ask.
/**
* Opens a dialog in the given context asking the user to download
* SoundCloud from their play store or equivalent.
*/
public void ask() {
final Builder builder = new AlertDialog.Builder(mContext);
final int dialogMessage = getDialogMessage();
builder.setMessage(dialogMessage).setCancelable(true).setPositiveButton(R.string.dialog_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
startSoundcloudMarketActivity();
}
}).setNegativeButton(R.string.dialog_no, new DialogInterface.OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
dialog.cancel();
}
}).show();
}
use of android.app.AlertDialog.Builder in project phonegap-facebook-plugin by Wizcorp.
the class Util method showAlert.
/**
* Display a simple alert dialog with the given text and title.
*
* @param context
* Android context in which the dialog should be displayed
* @param title
* Alert dialog title
* @param text
* Alert dialog message
*/
@Deprecated
public static void showAlert(Context context, String title, String text) {
Builder alertBuilder = new Builder(context);
alertBuilder.setTitle(title);
alertBuilder.setMessage(text);
alertBuilder.create().show();
}
use of android.app.AlertDialog.Builder in project ADWLauncher2 by boombuler.
the class LauncherActionPreference method onClick.
@Override
protected void onClick() {
AlertDialog.Builder builder = new Builder(getContext());
builder.setTitle(this.getTitle());
final ListAdapter adapter = LauncherActions.getInstance().getSelectActionAdapter();
builder.setAdapter(adapter, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Action act = (Action) adapter.getItem(which);
Intent intent = LauncherActions.getInstance().getIntentForAction(act);
String sIntent = intent.toUri(0).toString();
persistString(sIntent);
}
});
builder.create().show();
}
use of android.app.AlertDialog.Builder in project AnimeTaste by daimajia.
the class StartActivity method rateForUsOrCheckUpdate.
public void rateForUsOrCheckUpdate() {
if (mSharedPreferences.getInt("playcount", 0) > 10 && !mSharedPreferences.getBoolean("sharedApp", false)) {
AlertDialog.Builder builder = new Builder(mContext);
builder.setMessage(R.string.rate_share_message);
builder.setTitle(R.string.rate_share_title);
builder.setPositiveButton(R.string.rate_share_i_do, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getText(R.string.share_title));
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, getText(R.string.share_app_body));
startActivity(Intent.createChooser(shareIntent, getText(R.string.share_via)));
MobclickAgent.onEvent(mContext, "need_share");
}
});
builder.setNegativeButton(R.string.rate_share_sorry, null);
builder.show();
mSharedPreferences.edit().putBoolean("sharedApp", true).commit();
} else {
UmengUpdateAgent.update(this);
}
}
use of android.app.AlertDialog.Builder in project platform_frameworks_base by android.
the class ResolverTargetActionsDialogFragment method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Bundle args = getArguments();
final int itemRes = args.getBoolean(PINNED_KEY, false) ? R.array.resolver_target_actions_unpin : R.array.resolver_target_actions_pin;
return new Builder(getContext()).setCancelable(true).setItems(itemRes, this).setTitle(args.getCharSequence(TITLE_KEY)).create();
}
Aggregations