final ViewGroup layout_order = (ViewGroup) LayoutInflater.from(
Menus.this).inflate(R.layout.ex, null);
AlertDialog.Builder builder_order = new AlertDialog.Builder(
Menus.this);
builder_order.setView(layout_order);
Enumeration e = orderDataHT.keys();
Object obj;
obj = e.nextElement();
String quantity = (String) obj;
String instruction = (String) orderDataHT.get(obj);
System.out.println(quantity);
System.out.println(instruction);
setContentView(R.layout.ex);
builder_order.setView(layout_order);
TextView tv = (TextView) findViewById(R.id.quantitytext1);
tv.setText(quantity, BufferType.NORMAL);
TextView tv1 = (TextView) findViewById(R.id.instructiontext);
tv1.setText(instruction, BufferType.NORMAL);
builder_order.show();
0
A
回答
0
public void alert(String message)
{
new AlertDialog.Builder(this)
.setMessage(message)
.setTitle("Warning!!!")
.setCancelable(true)
.setNeutralButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton){}
})
.show();
}
它的功能,例如,如何即時通訊使用警報..呼叫:警報(「消息」);
+0
我從一個警報對話框中讀取數據,我將數據存儲在散列表中,我想要檢索用戶在另一個對話框中輸入的數據。 – sam 2011-03-07 09:57:04
0
Dialog ds;
public void exampleDialog()
{
sd = new Dialog(yourClassName.this);
mainW = new LinearLayout(getApplicationContext());
mainW.setOrientation(LinearLayout.VERTICAL);
// in mainW u can add buttons, TextViews, and other what u want .
sd.setContentView(mainW);
sd.setTitle("Download ");
//here code what you want for example
TextView text = new TextView(getApplicationContext());
text.setText("some text");
mainW.addView(text);
sd.setCancelable(true);
sd.show();
}
希望我能理解你。
相關問題
- 1. 自定義AlertDailog.Builder Android
- 2. 無法顯示
- 3. 無法顯示
- 4. ShowWindow無法顯示
- 5. FlatListFooter無法顯示
- 6. 無法顯示Applet
- 7. JavaScript無法顯示
- 8. 無法顯示MBProgressHUD
- 9. ListView無法顯示
- 10. 無法顯示SOAMANAGER
- 11. OpenGLView無法顯示
- 12. 無法顯示jsp
- 13. presentModalViewController無法顯示
- 14. 無法顯示png
- 15. 無法顯示值
- 16. MultiviewControl無法顯示
- 17. JOptionPane.showMessageDialog無法顯示
- 18. 無法顯示uiimagepickercontroller
- 19. UIButton無法顯示
- 20. UIWebView無法顯示
- 21. 無法顯示@Ignore
- 22. 無法顯示PSObject
- 23. MBProgressHUD無法顯示
- 24. 無法顯示adview,顯示:com.google.ads.AdView無法實例化。
- 25. 無法顯示div來自ng顯示
- 26. 如何從Alertdailog.builder獲取editText數據?
- 27. UIAlertController無法顯示UIAlertView中
- 28. WPF Webbrowser無法顯示角
- 29. 吐司無法顯示
- 30. 無法顯示計算值
嘗試添加更多的細節,你會得到更快的答案!什麼是實際的錯誤?你的logcat說什麼? – Blundell 2011-03-07 08:54:19