I'd like to add the ability to display captions on the photos in the
ImageSwitcher APIDemo. He's what I'm thinking:
- Use Toast to pop-up a string resource for the image that is
currently in the ImageSwitcher view, ie the big image
- Trigger that Toast from the options Menu
- onOptionsItemSelected(MenuItem item) should be aware of the position
variable, or someway to bind what image is shown to what caption
should be shown.
I'm stuck, any thoughts or ideas? Better solutions out there?
I've added the following code to the sample:
// Create a Menu that appears when the Menu button is pressed on
the device
@Override
public boolean onCreateOptionsMenu(Menu menu) {
Log.d("PicsOfStuff", "in public boolean onCreateOptionsMenu");
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
} //onCreateOptionsMenu
// Executed when the Menu item is clicked
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Log.d("PicsOfStuff", "in public boolean onOptionsItemSelected");
switch (item.getItemId()) {
case R.id.caption:
Log.d("PicsOfStuff", "caption should display here");
// more here
}
return false;
} // onOptionsItemSelected
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en