android.app.AlertDialog.setTitle()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中android.app.AlertDialog.setTitle()方法的一些代码示例,展示了AlertDialog.setTitle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AlertDialog.setTitle()方法的具体详情如下:
包路径:android.app.AlertDialog
类名称:AlertDialog
方法名:setTitle

AlertDialog.setTitle介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

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!
  }

});

代码示例来源:origin: stackoverflow.com

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();

代码示例来源:origin: stackoverflow.com

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();

代码示例来源:origin: stackoverflow.com

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();
  }
}

代码示例来源:origin: stackoverflow.com

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;
      }
    });
}

代码示例来源:origin: stackoverflow.com

AlertDialog alert = new AlertDialog.Builder(this).create();
alert.setTitle(title);
alert.setMessage(message);

代码示例来源:origin: stackoverflow.com

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();
}     });

代码示例来源:origin: stackoverflow.com

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();

代码示例来源:origin: stackoverflow.com

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();
    }

代码示例来源:origin: stackoverflow.com

// 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();

代码示例来源:origin: stackoverflow.com

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();

代码示例来源:origin: stackoverflow.com

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
   }
});

代码示例来源:origin: stackoverflow.com

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);

代码示例来源:origin: stackoverflow.com

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();
}

代码示例来源:origin: stackoverflow.com

public AlertDialog CreateAlert(String title, String message) {
   AlertDialog alert = new AlertDialog.Builder(this).create();
   alert.setTitle(title);
   alert.setMessage(message);
   alert.show();
   return alert;
 }

代码示例来源:origin: stackoverflow.com

AlertDialog alertDialog = new AlertDialog.Builder(this).create();
 // Setting Dialog Title
alertDialog.setTitle(e.getMessage());
if(!mActivity.this.isFinishing()) {
   alertDialog.show();
}

代码示例来源:origin: stackoverflow.com

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
           }
         });

代码示例来源:origin: stackoverflow.com

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();
  }
}

代码示例来源:origin: stackoverflow.com

@Override
   protected void onPostExecute(String s) {
     AlertDialog alertDialog = new AlertDialog.Builder(ctx).create();
     alertDialog.setTitle("Login successful");
     alertDialog.setMessage(s);
     alertDialog.show();
   }

代码示例来源:origin: org.openmobster.core.mobileCloud.android.2_0/native-framework

public void start()
{
  AlertDialog appDialog = new AlertDialog.Builder(currentActivity).
  setItems(new String[]{"Enterprise App Store","Push", "Cloud Status"}, 
  new ClickListener()).
  setCancelable(true).
  create();
  
  appDialog.setTitle("CloudManager");
          
  appDialog.show();
}

相关文章