Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b8b1b61 authored by Andrew Solovay's avatar Andrew Solovay
Browse files

docs: Fixed error in code sample.

The code sample didn't match the sample project. Also rewrote one
paragraph to clarify that you *create* a particular XML file (external
bug report said the file was missing from the sample project).

Also fixed formatting in a different line sample (overlong line
forced code box to scroll).

Doc is staged to:
http://asolovay.mtv:9098/training/contacts-provider/retrieve-names.html#NameMatch

bug: 15377898
Change-Id: I0898956255aa9174b12811e6f6ca826434b28c20
parent 47ede834
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -102,9 +102,9 @@ trainingnavtop=true
<p>
    To display the search results in a {@link android.widget.ListView}, you need a main layout file
    that defines the entire UI including the {@link android.widget.ListView}, and an item layout
    file that defines one line of the {@link android.widget.ListView}. For example, you can define
    the main layout file <code>res/layout/contacts_list_view.xml</code> that contains the
    following XML:
    file that defines one line of the {@link android.widget.ListView}. For example, you could create
    the main layout file <code>res/layout/contacts_list_view.xml</code> with
    the following XML:
</p>
<pre>
&lt;?xml version="1.0" encoding="utf-8"?&gt;
@@ -250,7 +250,8 @@ public class ContactsFragment extends Fragment implements
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        // Inflate the fragment layout
        return inflater.inflate(R.layout.contacts_list_layout, container, false);
        return inflater.inflate(R.layout.contact_list_fragment,
            container, false);
    }
</pre>
<h3 id="DefineAdapter">Set up the CursorAdapter for the ListView</h3>
@@ -268,7 +269,8 @@ public class ContactsFragment extends Fragment implements
        super.onActivityCreated(savedInstanceState);
        ...
        // Gets the ListView from the View list of the parent activity
        mContactsList = (ListView) getActivity().findViewById(R.layout.contact_list_view);
        mContactsList =
            (ListView) getActivity().findViewById(R.layout.contact_list_view);
        // Gets a CursorAdapter
        mCursorAdapter = new SimpleCursorAdapter(
                getActivity(),