Search in sources :

Example 51 with Builder

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();
}
Also used : DialogInterface(android.content.DialogInterface) Builder(android.app.AlertDialog.Builder)

Example 52 with Builder

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();
}
Also used : Builder(android.app.AlertDialog.Builder)

Example 53 with Builder

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();
}
Also used : AlertDialog(android.app.AlertDialog) Action(org.adw.launcher2.actions.LauncherActions.Action) DialogInterface(android.content.DialogInterface) Builder(android.app.AlertDialog.Builder) Builder(android.app.AlertDialog.Builder) OnClickListener(android.content.DialogInterface.OnClickListener) Intent(android.content.Intent) ListAdapter(android.widget.ListAdapter)

Example 54 with Builder

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);
    }
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) Builder(android.app.AlertDialog.Builder) Builder(android.app.AlertDialog.Builder) OnClickListener(android.content.DialogInterface.OnClickListener) Intent(android.content.Intent)

Example 55 with Builder

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();
}
Also used : Bundle(android.os.Bundle) Builder(android.app.AlertDialog.Builder)

Aggregations

Builder (android.app.AlertDialog.Builder)112 DialogInterface (android.content.DialogInterface)64 AlertDialog (android.app.AlertDialog)42 Intent (android.content.Intent)29 View (android.view.View)28 TextView (android.widget.TextView)25 OnClickListener (android.content.DialogInterface.OnClickListener)21 SuppressLint (android.annotation.SuppressLint)16 ArrayList (java.util.ArrayList)15 OnClickListener (android.view.View.OnClickListener)13 ImageView (android.widget.ImageView)13 Context (android.content.Context)12 AlertDialog (android.support.v7.app.AlertDialog)12 List (java.util.List)12 Bundle (android.os.Bundle)11 RelativeLayout (android.widget.RelativeLayout)10 Point (android.graphics.Point)9 ExpandableListView (android.widget.ExpandableListView)9 ImageButton (android.widget.ImageButton)7 EditText (android.widget.EditText)6