Adding LoaderCursor sample based on the LoaderCursor API demo.
Change-Id: Ibfbc973eb01495283f25f6d686f1bc3e658d7401
diff --git a/content/LoaderCursor/AndroidManifest.xml b/content/LoaderCursor/AndroidManifest.xml
new file mode 100644
index 0000000..2305045
--- /dev/null
+++ b/content/LoaderCursor/AndroidManifest.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.content.loadercursor"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-sdk
+ android:minSdkVersion="14"
+ android:targetSdkVersion="17" />
+ <uses-permission android:name="android.permission.READ_CONTACTS"/>
+
+ <application
+ android:allowBackup="true"
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
+ <activity
+ android:name="com.example.android.content.loadercursor.MainActivity"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
diff --git a/content/LoaderCursor/loadercursor.jd b/content/LoaderCursor/loadercursor.jd
new file mode 100644
index 0000000..dba0a0f
--- /dev/null
+++ b/content/LoaderCursor/loadercursor.jd
@@ -0,0 +1,14 @@
+page.title=LoaderCursor Sample
+@jd:body
+
+<p>This sample demonstrates the use of the
+<pre><a href="http://developer.android.com/reference/android/app/LoaderManager.html">LoaderManager
+</a></pre> to retrieve data from a
+<pre><a href="http://developer.android.com/reference/android/database/Cursor.html">Cursor</a></pre>
+.</p>
+
+<p>Here, a list of contacts is displayed in a
+<pre><a href="http://developer.android.com/reference/android/app/ListFragment.html">ListFragment
+</a></pre> and filtered using a
+<pre><a href="http://developer.android.com/reference/android/widget/SearchView.html">SearchView
+</a></pre> ActionBar item.</p>
\ No newline at end of file
diff --git a/content/LoaderCursor/res/drawable-hdpi/ic_launcher.png b/content/LoaderCursor/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a196c51
--- /dev/null
+++ b/content/LoaderCursor/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/content/LoaderCursor/res/drawable-mdpi/ic_launcher.png b/content/LoaderCursor/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..7cde937
--- /dev/null
+++ b/content/LoaderCursor/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/content/LoaderCursor/res/drawable-xhdpi/ic_launcher.png b/content/LoaderCursor/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..ab34c07
--- /dev/null
+++ b/content/LoaderCursor/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/content/LoaderCursor/res/drawable-xxhdpi/ic_launcher.png b/content/LoaderCursor/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..9c5a93d
--- /dev/null
+++ b/content/LoaderCursor/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/content/LoaderCursor/res/layout/activity_main.xml b/content/LoaderCursor/res/layout/activity_main.xml
new file mode 100644
index 0000000..9ef8d23
--- /dev/null
+++ b/content/LoaderCursor/res/layout/activity_main.xml
@@ -0,0 +1,34 @@
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/FrameLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ tools:context=".MainActivity" >
+
+ <fragment
+ android:id="@+id/fragment_list"
+ android:name="com.example.android.content.loadercursor.CursorLoaderListFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+</FrameLayout>
diff --git a/content/LoaderCursor/res/menu/main.xml b/content/LoaderCursor/res/menu/main.xml
new file mode 100644
index 0000000..b7aba0f
--- /dev/null
+++ b/content/LoaderCursor/res/menu/main.xml
@@ -0,0 +1,26 @@
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <item
+ android:id="@+id/action_search"
+ android:actionViewClass="android.widget.SearchView"
+ android:icon="@android:drawable/ic_menu_search"
+ android:showAsAction="ifRoom|collapseActionView"
+ android:title="@string/action_search"/>
+
+</menu>
diff --git a/content/LoaderCursor/res/values-sw600dp/dimens.xml b/content/LoaderCursor/res/values-sw600dp/dimens.xml
new file mode 100644
index 0000000..08cfee1
--- /dev/null
+++ b/content/LoaderCursor/res/values-sw600dp/dimens.xml
@@ -0,0 +1,24 @@
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+
+ <!--
+ Customize dimensions originally defined in res/values/dimens.xml (such as
+ screen margins) for sw600dp devices (e.g. 7" tablets) here.
+ -->
+
+</resources>
diff --git a/content/LoaderCursor/res/values-sw720dp-land/dimens.xml b/content/LoaderCursor/res/values-sw720dp-land/dimens.xml
new file mode 100644
index 0000000..88cf8c5
--- /dev/null
+++ b/content/LoaderCursor/res/values-sw720dp-land/dimens.xml
@@ -0,0 +1,25 @@
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+
+ <!--
+ Customize dimensions originally defined in res/values/dimens.xml (such as
+ screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
+ -->
+ <dimen name="activity_horizontal_margin">128dp</dimen>
+
+</resources>
diff --git a/content/LoaderCursor/res/values-v11/styles.xml b/content/LoaderCursor/res/values-v11/styles.xml
new file mode 100644
index 0000000..14848da
--- /dev/null
+++ b/content/LoaderCursor/res/values-v11/styles.xml
@@ -0,0 +1,27 @@
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+
+ <!--
+ Base application theme for API 11+. This theme completely replaces
+ AppBaseTheme from res/values/styles.xml on API 11+ devices.
+ -->
+ <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
+ <!-- API 11 theme customizations can go here. -->
+ </style>
+
+</resources>
diff --git a/content/LoaderCursor/res/values-v14/styles.xml b/content/LoaderCursor/res/values-v14/styles.xml
new file mode 100644
index 0000000..cb99309
--- /dev/null
+++ b/content/LoaderCursor/res/values-v14/styles.xml
@@ -0,0 +1,28 @@
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+
+ <!--
+ Base application theme for API 14+. This theme completely replaces
+ AppBaseTheme from BOTH res/values/styles.xml and
+ res/values-v11/styles.xml on API 14+ devices.
+ -->
+ <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
+ <!-- API 14 theme customizations can go here. -->
+ </style>
+
+</resources>
diff --git a/content/LoaderCursor/res/values/dimens.xml b/content/LoaderCursor/res/values/dimens.xml
new file mode 100644
index 0000000..393aba0
--- /dev/null
+++ b/content/LoaderCursor/res/values/dimens.xml
@@ -0,0 +1,23 @@
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+
+ <!-- Default screen margins, per the Android Design guidelines. -->
+ <dimen name="activity_horizontal_margin">16dp</dimen>
+ <dimen name="activity_vertical_margin">16dp</dimen>
+
+</resources>
diff --git a/content/LoaderCursor/res/values/strings.xml b/content/LoaderCursor/res/values/strings.xml
new file mode 100644
index 0000000..a2c19df
--- /dev/null
+++ b/content/LoaderCursor/res/values/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+
+ <string name="app_name">LoaderCursor</string>
+ <string name="action_search">Search</string>
+
+</resources>
diff --git a/content/LoaderCursor/res/values/styles.xml b/content/LoaderCursor/res/values/styles.xml
new file mode 100644
index 0000000..c8ee17f
--- /dev/null
+++ b/content/LoaderCursor/res/values/styles.xml
@@ -0,0 +1,36 @@
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+
+ <!--
+ Base application theme, dependent on API level. This theme is replaced
+ by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
+ -->
+ <style name="AppBaseTheme" parent="android:Theme.Light">
+ <!--
+ Theme customizations available in newer API levels can go in
+ res/values-vXX/styles.xml, while customizations related to
+ backward-compatibility can go here.
+ -->
+ </style>
+
+ <!-- Application theme. -->
+ <style name="AppTheme" parent="AppBaseTheme">
+ <!-- All customizations that are NOT specific to a particular API-level can go here. -->
+ </style>
+
+</resources>
diff --git a/content/LoaderCursor/src/com/example/android/content/loadercursor/CursorLoaderListFragment.java b/content/LoaderCursor/src/com/example/android/content/loadercursor/CursorLoaderListFragment.java
new file mode 100644
index 0000000..9a1726a
--- /dev/null
+++ b/content/LoaderCursor/src/com/example/android/content/loadercursor/CursorLoaderListFragment.java
@@ -0,0 +1,232 @@
+/*
+ * Copyright 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.content.loadercursor;
+
+import android.app.ListFragment;
+import android.app.LoaderManager;
+import android.content.CursorLoader;
+import android.content.Loader;
+import android.database.Cursor;
+import android.net.Uri;
+import android.os.Bundle;
+import android.provider.ContactsContract.Contacts;
+import android.text.TextUtils;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ListView;
+import android.widget.SearchView;
+import android.widget.SearchView.OnCloseListener;
+import android.widget.SearchView.OnQueryTextListener;
+import android.widget.SimpleCursorAdapter;
+import android.widget.Toast;
+
+/**
+ * A {@link ListFragment} that shows the use of a {@link LoaderManager} to
+ * display a list of contacts accessed through a {@link Cursor}.
+ */
+public class CursorLoaderListFragment extends ListFragment implements
+ LoaderManager.LoaderCallbacks<Cursor> {
+
+ // This is the Adapter being used to display the list's data.
+ SimpleCursorAdapter mAdapter;
+
+ // The SearchView for doing filtering.
+ SearchView mSearchView;
+
+ // If non-null, this is the current filter the user has provided.
+ String mCurFilter;
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+
+ // Give some text to display if there is no data. In a real
+ // application this would come from a resource.
+ setEmptyText("No phone numbers");
+
+ // We have a menu item to show in action bar.
+ setHasOptionsMenu(true);
+
+ /*
+ * Create an empty adapter we will use to display the loaded data. The
+ * simple_list_item_2 layout contains two rows on top of each other
+ * (text1 and text2) that will show the contact's name and status.
+ */
+ mAdapter = new SimpleCursorAdapter(getActivity(),
+ android.R.layout.simple_list_item_2, null,
+ new String[] {
+ Contacts.DISPLAY_NAME, Contacts.CONTACT_STATUS
+ },
+ new int[] {
+ android.R.id.text1, android.R.id.text2
+ }, 0);
+ setListAdapter(mAdapter);
+
+ // Start out with a progress indicator.
+ setListShown(false);
+
+ // BEGIN_INCLUDE(getloader)
+ // Prepare the loader. Either re-connect with an existing one,
+ // or start a new one.
+ getLoaderManager().initLoader(0, null, this);
+ // END_INCLUDE(getloader)
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+
+ inflater.inflate(R.menu.main, menu);
+
+ // Get the search item and update its action view
+ MenuItem item = menu.findItem(R.id.action_search);
+ mSearchView = (SearchView) item.getActionView();
+ mSearchView.setOnQueryTextListener(queryListener);
+ mSearchView.setOnCloseListener(closeListener);
+ mSearchView.setIconifiedByDefault(true);
+ }
+
+ /**
+ * The {@link OnCloseListener} called when the SearchView is closed. Resets
+ * the query field.
+ */
+ private SearchView.OnCloseListener closeListener = new SearchView.OnCloseListener() {
+
+ @Override
+ public boolean onClose() {
+ // Restore the SearchView if a query was entered
+ if (!TextUtils.isEmpty(mSearchView.getQuery())) {
+ mSearchView.setQuery(null, true);
+ }
+ return true;
+ }
+ };
+
+ /**
+ * The {@link OnQueryTextListener} that is called when text in the
+ * {@link SearchView} is changed. Updates the query filter and triggers a
+ * reload of the {@link LoaderManager} to update the displayed list.
+ */
+ private OnQueryTextListener queryListener = new OnQueryTextListener() {
+
+ /**
+ * Called when the action bar search text has changed. Update the search
+ * filter, and restart the loader to do a new query with this filter.
+ *
+ * @param newText the new content of the query text field
+ * @return true, the action has been handled.
+ */
+ public boolean onQueryTextChange(String newText) {
+
+ String newFilter = !TextUtils.isEmpty(newText) ? newText : null;
+
+ // Don't do anything if the filter hasn't actually changed.
+ // Prevents restarting the loader when restoring state.
+ if (mCurFilter == null && newFilter == null) {
+ return true;
+ }
+ if (mCurFilter != null && mCurFilter.equals(newFilter)) {
+ return true;
+ }
+
+ // Restart the Loader.
+ // #onCreateLoader uses the value of mCurFilter as a filter when
+ // creating the query for the Loader.
+ mCurFilter = newFilter;
+ getLoaderManager().restartLoader(0, null, CursorLoaderListFragment.this);
+
+ return true;
+ }
+
+ @Override
+ public boolean onQueryTextSubmit(String query) {
+ // Don't care about this.
+ return true;
+ }
+ };
+
+ /**
+ * An item has been clicked in the {@link ListView}. Display a toast with
+ * the tapped item's id.
+ */
+ @Override
+ public void onListItemClick(ListView l, View v, int position, long id) {
+ Toast.makeText(getActivity(), "Item clicked: " + id, Toast.LENGTH_LONG).show();
+ }
+
+ // These are the Contacts rows that we will retrieve.
+ static final String[] CONTACTS_SUMMARY_PROJECTION = new String[] {
+ Contacts._ID,
+ Contacts.DISPLAY_NAME,
+ Contacts.CONTACT_STATUS,
+ Contacts.LOOKUP_KEY,
+ };
+
+ // BEGIN_INCLUDE(oncreateloader)
+ public Loader<Cursor> onCreateLoader(int id, Bundle args) {
+ // This is called when a new Loader needs to be created. This
+ // sample only has one Loader, so we don't care about the ID.
+ // First, pick the base URI to use depending on whether we are
+ // currently filtering.
+ Uri baseUri;
+ if (mCurFilter != null) {
+ baseUri = Uri.withAppendedPath(Contacts.CONTENT_FILTER_URI,
+ Uri.encode(mCurFilter));
+ } else {
+ baseUri = Contacts.CONTENT_URI;
+ }
+
+ // Now create and return a CursorLoader that will take care of
+ // creating a Cursor for the data being displayed.
+ String select = "((" + Contacts.DISPLAY_NAME + " NOTNULL) AND ("
+ + Contacts.HAS_PHONE_NUMBER + "=1) AND ("
+ + Contacts.DISPLAY_NAME + " != '' ))";
+ String order = Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC";
+
+ return new CursorLoader(getActivity(), baseUri,
+ CONTACTS_SUMMARY_PROJECTION, select, null, order);
+ }
+
+ // END_INCLUDE(oncreateloader)
+
+ // BEGIN_INCLUDE(onloadfinished)
+ public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
+ // Swap the new cursor in. (The framework will take care of closing the
+ // old cursor once we return.)
+ mAdapter.swapCursor(data);
+
+ // The list should now be shown.
+ if (isResumed()) {
+ setListShown(true);
+ } else {
+ setListShownNoAnimation(true);
+ }
+ }
+
+ // END_INCLUDE(onloadfinished)
+
+ // BEGIN_INCLUDE(onloaderreset)
+ public void onLoaderReset(Loader<Cursor> loader) {
+ // This is called when the last Cursor provided to onLoadFinished()
+ // above is about to be closed. We need to make sure we are no
+ // longer using it.
+ mAdapter.swapCursor(null);
+ }
+ // END_INCLUDE(onloaderreset)
+
+}
diff --git a/content/LoaderCursor/src/com/example/android/content/loadercursor/MainActivity.java b/content/LoaderCursor/src/com/example/android/content/loadercursor/MainActivity.java
new file mode 100644
index 0000000..c053b90
--- /dev/null
+++ b/content/LoaderCursor/src/com/example/android/content/loadercursor/MainActivity.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.content.loadercursor;
+
+import android.app.Activity;
+import android.app.ListFragment;
+import android.app.LoaderManager;
+import android.database.Cursor;
+import android.os.Bundle;
+import android.widget.SearchView;
+
+/**
+ * The entry point to the CursorLoader sample. This sample demonstrates the use
+ * of the {@link LoaderManager} to retrieve data from a {@link Cursor}. Here, a
+ * list of contacts is displayed in a {@link ListFragment} and filtered using a
+ * {@link SearchView} ActionBar item.
+ */
+public class MainActivity extends Activity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ }
+
+}