Article: A custom AlertDialog allows you to create a layout featuring it's own parameters and can obtain information that can be used to obtain a user's login information, configuration settings and more. You can create a new layout that will be created in XML coding format. Some Android SDK provide the ability to use a drag-and-drop function to easily create a layout that will auto-convert into XML for you. From the menu bar at the top of the window, click on File>New>XML>Layout XML File. Provide a layout file name then click on Finish. Your new layout will appear in the main window pane. You can add in components using one of two methods. You can open the layout file from looking in the project hierarchy shown on the left hand side. Then open the following folder paths: "<AppName>>app>src>main>res>layout" A new class will allow you to separate the code for your unique alert layout. Click on File>New>Java Class. Type in a name for your new Java class then click on OK. For this example, we will call this example class "CustomDialogExample." The Dialog Fragment allows for maximum compatibility with the different versions of Android OS. import android.support.v4.app.DialogFragment; Make sure the main class method extends to the DialogFragment. public class CustomDialogExample extends DialogFragment A Layout Inflater instantiates a layout XML file into view objects. A View object is the basic structure for user interface components in a rectangular screen space and draws objects and widgets on screen. LayoutInflater inflater; View customView; We will need for it to be public so that it can be accessed elsewhere in the application and it will return a Dialog object. It will take in a Bundle object. public Dialog onCreateDialog(Bundle savedInstanceState){ } With the LayoutInflater and View objects created, inflate the layout and obtain the custom layout onto the View object from within the onCreateDialog function. inflater = getActivity().getLayoutInflater(); customView = inflater.inflate(R.layout.dialog_custom_background, null); In the onCreateDialog function, use the AlertDialog builder to create the layout. AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());}} You may wish to add in a button to close the AlertDialog. builder.setView(customView).setPositiveButton("OK", new OnClickListener() { public void onClick(DialogInterface dialog, int which){} }); Because we are not in the main focus of the application, we will end the onCreateDialog function by returning with our new AlertDialog. return builder.create(); You will need to call upon your function from elsewhere, such as the main method of your application. For this example, we will call this public function customAlertDialogExample which will take in a View object. public void customAlertDialogExample(View customView) { CustomDialogExample dialog = new CustomDialogExample(); dialog.show(getSupportFragmentManager(), "MyCustomAlertDialog"); }
Question: What is a summary of what this article is about?
Create a custom layout. Add in widgets or other components to the layout. Create a new Java Class. Import the Dialog Fragment. Create a layout inflater object and a view object. Create the custom dialog layout. Inflate the layout from the custom XML layout. Build the custom AlertDialog. Return the custom AlertDialog. Call for the custom AlertDialog from the main method.
Article: Even if you aren't required to have a card, you should still take the time to get your certification. This will let you lead by example and properly educate your employees on food safety. Some restaurants don't require all employees to have a card. Instead, they follow a rule that there must be 1 certified employee working at all open hours who can teach everyone else. This is often the case with food truck businesses with unwrapped food or food preparation involved. The rules can change depending on your city or municipality. If you're not sure if the rule applies to you, call your city health department and ask. It's always better to be clear on the rules than accidentally break one!
Question: What is a summary of what this article is about?
Get your certification if you are the owner or manager. Ask your boss if your position requires a food handler's card. Call your city health department if you have any questions.
Article: Inviting 30 people over to your house for beer pong is probably a good reason to bring your ancient Roman vase collection to the attic. Anything you don't want touched, messed with, or potentially broken needs to put out of sight. Shut the doors to rooms you don't want entered, lock them, tidy up the bathroom, and get your home in party condition. You'll probably want to have garbage bags and cleaning supplies at the ready, too, just to make everything easier. Have games and alternative choices of music out just in case the party needs a little revamping. Get a couple of your closest friends together to help prepare your house for the party. This is also a plus for when guests start showing up; it looks like people are already there and in case someone not so well-known shows up early, it'll save you from an awkward situation. Direct each guest as they show up to the designated food, beverage, and entertainment areas. You want them feeling comfortable right off the bat. Mingle and get to know the people you might not know so well. If there's alcohol involved at your party, make sure everyone who wants to drink has a drink in their hand. Turn the music up enough so that you can still comfortably hear one another. Make sure your guests are comfortable with one another by introducing those that aren't known that well to your group of friends. You may also want to start with the party activities and turn the music up louder to enforce a party atmosphere. Monitor the alcohol counter to keep anyone from overdoing it with hard liquor. For groups that don't know each other, you may need to start conversations rolling. That's why you're the host! If the party starts reaching a lull, feel free to call it a night. Just start cleaning up and telling people thanks for coming and they'll get the hint. If they don't, just tell them the party's over! They don't have to go home, but they can't stay there. Make sure everyone gets home okay. Do they have your number? Are they okay to drive? Does anyone need a ride? If they can't drive, do you have a sofa or bed they can crash on? If your entire living room is a pyramid of aluminum cans and delicately placed paper plates, you have more than enough right to ask your guests to help clean up. It's their mess, too! If that thought makes you nervous, ask a few of your closest friends to tackle the beast before they leave. You'll pay them back when they host next time!
Question: What is a summary of what this article is about?
Prep your home, if applicable. Get everything set up. Keep your guests happy. Ask others for help cleaning up.