How many buttons can the Android Standard dialog box have? What is the way to display a dialog button?
3 of them.
New Alertdialog.builder (this). Settitle ("My dialog Box"). Setpositivebutton ("Off", new Dialoginterface.onclicklistener () {p ublic void OnClick (dialoginterface dialog, int whichbutton) {//todo}}). Show ();
How do I implement a list without using an external layout using only Alertdialog?
Use the AlertDialog.Builder.setItems () method.
Http://www.open-open.com/lib/view/open1326155119828.html
How do I display a string array as a data source in a list in a standard dialog box and add an option button after the list item?
Use the AlertBuilder.Builder.setSingleChoiceItems method.
How do I set a progress bar for a dialog box?
Long-Form Progress bar dialog box:
Xh_pdialog = new ProgressDialog (activity01.this); Xh_pdialog.setprogressstyle (progressdialog.style_horizontal); xh_ Pdialog.settitle ("hint"); Xh_pdialog.setmessage ("This is a long-form progress bar dialog box"); Xh_pdialog.seticon (R.DRAWABLE.IMG2); xh_ Pdialog.setindeterminate (false); xh_pdialog.setprogress (+); xh_pdialog.setcancelable (true); Xh_pdialog.show ();
Circular:
Xh_pdialog = new ProgressDialog (activity01.this); Xh_pdialog.setprogressstyle (Progressdialog.style_spinner); xh_ Pdialog.settitle ("hint"); Xh_pdialog.setmessage ("This is a circular progress bar dialog box"); Xh_pdialog.seticon (R.DRAWABLE.IMG1); xh_ Pdialog.setindeterminate (false); xh_pdialog.setcancelable (true); Xh_pdialog.setbutton ("OK", New Bt1dialoglistener ( ); Xh_pdialog.show ();
How do I place visual components anywhere in the standard dialog box?
Use the AlertDialog.Builder.setView method.
How many ways does the dialog box appear?
1: Display the dialog box directly using Alertdialog.
2:activity.showdialog (int), the method invokes the Activity.oncreatedialog method, passes in the int parameter, and then determines what dialog box is displayed based on the value of the parameter.
How do I change the display position of a dialog box?
window window = Alertdialog.getwindow (); Window.setgravity (Gravity.top | Gravity.left)
How do I change the transparency of a dialog box?
Sets the Alpha property of the window.
Show the code for toast?
Toast.maketext (This, "My Information", Toast.length_long)
Can the following code display the Toast information box normally? Why?
Toast toast = new Toast (this); Toast.settext ("xxx"); Toast.show ();
No. The Maketext method creates a View object with TextView, and the SetText method sets the text in the TextView component.
How do I control the display and shutdown of the Toast info box?
There is an inline class tn in the toast class that has two methods, show and hide, to display and close the Toast information box, respectively. The TN object needs to be captured in Java reflection.
Show the steps for notification?
1: Call the Context.getsystemservice (Notification_service) method to return to the Notificationmanager instance
2: Construct Notification instance with Notification constructor public Notification (int icon, charsequence tickertext, Long)
3:notify () Send a notification to cancel (...) Cancel Notification
How do I eject an activity after I click notification?
Use the Pendingintent.getactivity method to get a Pendingintent object and pass it to the last parameter of the Setlatesteventinfo method.
How do I clear notification from the status bar?
Use the Notificationmanager.cancel method.
How do i put notification in the "In Progress" column?
Set the flag property of notification to Ongoing_event.
How do I customize notification?
Set the Notification.contentview variable.
What kinds of menus does Android support?
Options menu, context menu, submenu.
Which menus can display images?
Options menu (menu item), context menu, and submenu (menu header only)
Create a sub-menu core code?
@Overridepublic boolean Oncreateoptionsmenu (Menu menu) {submenu Uploadsubmenu=menu.addsubmenu (0, UPLOAD, 0, "upload"); Uploadsubmenu.seticon (R.drawable.upload); Uploadsubmenu.setheadericon (r.drawable.upload);//Set the title of the submenu Uploadsubmenu.setheadertitle ("Upload parameter Settings");//Set the submenu's title by default to " Upload "uploadsubmenu.add (0, sub_upload_a, 0," upload parameter 1 "); Uploadsubmenu.add (0, sub_upload_b, 0, "Upload parameter 2"); submenu Downloadsubmenu=menu.addsubmenu (0, DOWNLOAD, 0, "download"); Downloadsubmenu.seticon (R.drawable.download); return Super.oncreateoptionsmenu (menu);}
"Android Interview book" Study Notes (Fourth: dialog boxes, informational tips and menus)