• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/9

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

9 Cards in this Set

  • Front
  • Back

contextual action

associated with a single view

recommended way to present contextual actions

pre-honeycomb: floating context menu


post-honeycomb: contextual action bar

general steps to create a pre-honeycomb floating context menu

1. Create new xml file with menu as root element and item tags within it


2.Create code to inflate context menu


3. Register a view for the context menu


4. Override onContextItemSelected(...)



general steps to create post-honeycomb contextual action bar in listview or gridview

1. Create new xml file with menu as root element and item tags within it


2. Set MultiChoiceModeListener


3. Create ActionModeCallback and implement lifecycle methods


4. Create List State Drawable resource to change appearance of views based on whether they're selected





pre-honeycomb floating context menu: if you have more than one context menu resource, how do you know which to inflate?

check the id of the view passed to onCreateContextMenu(...)

Does a long-press of a view trigger a context menu by default?

No. You must register a view to show a floating context menu




public void registerForContextMenu(View view) //pass in the view in question

When a list view is in contextual action mode, can you allow for multiple item selection?

yes

How do you change the background of a view based on its state?

use a state list drawable, which is an XML resource where you have a drawable and then list the states it should appear in




Live in the res/drawable directory

How do you implement contextual action bar for views other than a listview or gridview?

1. set listener that implements View.OnLongClickListener


2. Within listener, create instance of ActionMode by calling Activity.startActionMode(...)


3. Create implementation of ActionModeCallback, including lifecycle methods