Button more = (Button) findViewById(R.id.more); more.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { //Intent myIntent = new Intent(view.getContext(), agones.class); //startActivityForResult(myIntent, 0); AlertDialog alertDialog = new AlertDialog.Builder(<YourActivityName>this).create(); //Read Update alertDialog.setTitle("hi"); alertDialog.setMessage("this is my app"); alertDialog.setButton("Continue..", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // here you can add functions } }); alertDialog.show(); //<-- See This! } });
AlertDialog alertDialog; alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setCanceledOnTouchOutside(false); alertDialog.setTitle(""); alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); alertDialog.show();
public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); alert.setTitle("Pages Finished"); public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); alert.setTitle("Pages Started"); builder.setTitle("Loading..."); alert=builder.create(); alert.show();
public class MyDialog extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setTitle("your title"); alertDialog.setMessage("your message"); alertDialog.setIcon(R.drawable.icon); alertDialog.show(); } }
public static void setDialog(String title, String message,AlertDialog alertDialog){ alertDialog.setTitle(title); alertDialog.setMessage(message); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,int which) { return; } }); }
AlertDialog alert = new AlertDialog.Builder(this).create(); alert.setTitle(title); alert.setMessage(message);
public void createbtnteam_westernbulldogs() { AlertDialog alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setIcon(R.drawable.team_westernbulldogs); alertDialog.setTitle("What kind of Banner do you Want to Create?"); alertDialog.setButton("Text", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { createText(); } alertDialog.setIcon(R.drawable.icon); alertDialog.show(); } });
final EditText input = new EditText(this); AlertDialog alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setTitle("Title"); alertDialog.setMessage("Message"); alertDialog.setView(input, 10, 0, 10, 0); // 10 spacing, left and right alertDialog.setButton("OK", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // Clicked } }); alertDialog.show();
if (isOnline()) { //code if online } else { AlertDialog alertDialog = new AlertDialog.Builder(getActivity()) .create(); alertDialog.setTitle("Info"); alertDialog .setMessage("Internet Not Available, Cross Check Your Internet Connectivity and Try Again!"); alertDialog.show(); }
// Get our tools AlertDialog dialog; AlertDialog.Builder builder; // The EditText to show your Text LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.dialog, (ViewGroup) this.findViewById(R.id.showText)); EditText showText = (EditText) layout.findViewById(R.id.showText); showText.setText("Some selectable text goes here."); // Build the Dialog builder = new AlertDialog.Builder(this); builder.setView(layout); dialog = builder.create(); // Some eye-candy dialog.setTitle("Selectable text"); dialog.setCancelable(true); dialog.show();
AlertDialog alertDialog; alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setCanceledOnTouchOutside(false); alertDialog.setCancelable(false); alertDialog.setTitle(""); alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); alertDialog.show();
AlertDialog alert = new AlertDialog.Builder(Myclass.this).create(); alert.setTitle("Verfication code"); alert.setMessage("your verification code is "+xyz); alert.setButton("confirm",new DialogInterface.onClickListener(){ public void onClick(DialogInterface d, int x){ //logic } });
final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); final EditText input = new EditText(this); input.setHint("hint"); alertDialog.setTitle("title"); alertDialog.setMessage(message); alertDialog.setView(input);
public void createAlert(String title, String message, Boolean button) { // http://androidideasblog.blogspot.com/2010/02/how-to-add-messagebox-in-android.html AlertDialog alertDialog; alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setTitle(title); alertDialog.setMessage(message); if ((button == true)) { alertDialog.setButton("Download Now", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { Intent browserIntent = new Intent( Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:com.google.zxing.client.android")); startActivity(browserIntent); } }); } alertDialog.show(); }
public AlertDialog CreateAlert(String title, String message) { AlertDialog alert = new AlertDialog.Builder(this).create(); alert.setTitle(title); alert.setMessage(message); alert.show(); return alert; }
if (stop - start > 1500) { // perform some action AlertDialog alert = new AlertDialog.Builder(Main.this).create(); alert.setTitle("Pick an option"); alert.setMessage("Pick an option dude!"); alert.setButton("Place a pin", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } });
public class DialogActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setTitle(" "); alertDialog.setMessage(""); alertDialog.setIcon(R.drawable.icon); alertDialog.setButton("Accept", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); alertDialog.setButton2("Deny", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); alertDialog.show(); } }
@Override protected void onPostExecute(String s) { AlertDialog alertDialog = new AlertDialog.Builder(ctx).create(); alertDialog.setTitle("Login successful"); alertDialog.setMessage(s); alertDialog.show(); }