可能重複:
How to print the data which is coming from the edittext?如何將EditText內容打印到日誌中?
final ViewGroup layout6 = (ViewGroup) LayoutInflater.from(Menus.this)
.inflate(R.layout.beefkabobsandwhichdialog, null);
AlertDialog.Builder builder6 = new AlertDialog.Builder(Menus.this);
builder6.setView(
LayoutInflater.from(Menus.this)
.inflate(R.layout.beefkabobsandwhichdialog, null));
builder6.setPositiveButton("Add2Order",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
String str = ((EditText)layout6.findViewById(R.id.quantityedittext1))
.getText().toString();
System.out.println(str);
}
});
爲什麼再次問候。你剛剛問過這個問題,不是嗎?有一個downvote和一個美好的一天。 – Klaus 2011-03-02 13:33:40
但我無法在logcat中打印str值... y? – sam 2011-03-02 13:37:47
重複:http://stackoverflow.com/questions/5167703/how-to-print-the-data-which-is-coming-from-the-edittext – HaskellElephant 2011-03-02 13:44:38