diff --git a/samples/ApiDemos/AndroidManifest.xml b/samples/ApiDemos/AndroidManifest.xml index d0d80eb01..6a2455325 100644 --- a/samples/ApiDemos/AndroidManifest.xml +++ b/samples/ApiDemos/AndroidManifest.xml @@ -1406,6 +1406,13 @@ + + + + + + + diff --git a/samples/ApiDemos/src/com/example/android/apis/content/ClipboardSample.java b/samples/ApiDemos/src/com/example/android/apis/content/ClipboardSample.java index e369ca9eb..6b840507f 100644 --- a/samples/ApiDemos/src/com/example/android/apis/content/ClipboardSample.java +++ b/samples/ApiDemos/src/com/example/android/apis/content/ClipboardSample.java @@ -118,7 +118,7 @@ public class ClipboardSample extends Activity { void updateClipData() { ClipData clip = mClipboard.getPrimaryClip(); - String[] mimeTypes = clip != null ? clip.filterMimeTypes("*/*") : null; + String[] mimeTypes = clip != null ? clip.getDescription().filterMimeTypes("*/*") : null; mMimeTypes.setText(""); if (mimeTypes != null) { for (int i=0; i(this, + android.R.layout.simple_list_item_activated_1, mStrings)); + getListView().setTextFilterEnabled(true); + + // Tell the list view to show one checked/activated item at a time. + getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); + + // Start with first item activated. + // Make the newly clicked item the currently selected one. + getListView().setItemChecked(0, true); + } + + @Override + protected void onListItemClick(ListView l, View v, int position, long id) { + // Make the newly clicked item the currently selected one. + getListView().setItemChecked(position, true); + } + + private String[] mStrings = Cheeses.sCheeseStrings; +}