DM461 Mobile Applications Lecture 5 - Utility UI Components Quiz
18 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What should you use the Positive action button for in an AlertDialog?

  • To remind the user later
  • To proceed with the action (correct)
  • To place a neutral option
  • To cancel the action
  • In an AlertDialog, where does the Neutral button typically appear in relation to the Positive and Negative buttons?

  • Between the Positive and Negative buttons (correct)
  • Before the Positive button
  • Randomly placed
  • After the Negative button
  • What is the purpose of a Tooltip in a UI?

  • To trigger an action
  • To display a small descriptive message near a view (correct)
  • To select a time or date
  • To represent positive and negative options
  • How do Android pickers help users in selecting a time or date?

    <p>By providing controls for selecting each part of the time or date</p> Signup and view all the answers

    What must be defined to create a DialogFragment for a TimePickerDialog?

    <p>TimePickerDialog.OnTimeSetListener</p> Signup and view all the answers

    Which kind of action should you use the Negative button for in an AlertDialog?

    <p>Cancel the action</p> Signup and view all the answers

    How can you display a TimePickerDialog using DialogFragment?

    <p>Define a fragment class that extends DialogFragment and return a TimePickerDialog from the fragment's onCreateDialog() method.</p> Signup and view all the answers

    What is the purpose of a dialog in mobile applications?

    <p>To prompt the user to make a decision or enter additional information</p> Signup and view all the answers

    What is the purpose of a Floating Action Button (FAB) in an app's UI?

    <p>To trigger the primary action in the app's UI.</p> Signup and view all the answers

    Why is it recommended to use subclasses like AlertDialog instead of instantiating Dialog directly?

    <p>Instantiating Dialog directly may cause UI inconsistencies</p> Signup and view all the answers

    How can you display a DatePickerDialog using DialogFragment?

    <p>Define a fragment class that extends DialogFragment and return a DatePickerDialog from the fragment's onCreateDialog() method.</p> Signup and view all the answers

    Which subclass of Dialog should be used to allow a user to select a date or time?

    <p>DatePickerDialog</p> Signup and view all the answers

    What is the purpose of a toast in an app?

    <p>To provide simple feedback about an operation in a small popup.</p> Signup and view all the answers

    What is the recommended approach for managing the appearance of a dialog in Android applications?

    <p>Using AlertDialog.Builder class to create the dialog</p> Signup and view all the answers

    What is the recommended alternative to using toasts when an app is in the foreground?

    <p>Displaying a Snackbar instead.</p> Signup and view all the answers

    In Android development, what is the role of the AlertDialog class?

    <p>To build different dialog designs efficiently</p> Signup and view all the answers

    When does a toast automatically disappear?

    <p>After it has been displayed for a specific timeout.</p> Signup and view all the answers

    Why is it important to use a DialogFragment as a container for dialogs?

    <p>To manage the appearance and lifecycle of the dialog</p> Signup and view all the answers

    Use Quizgecko on...
    Browser
    Browser