I’m developing a custom contacts app. I read default Contacts app source from Github and I don’t fully understand.
1, As far as I know ContactsSearchActivity will be called if an intent has action equal
com.android.contacts.action.FILTER_CONTACTS (full manifest)
<!-- The contacts search/filter UI -->
<activity android:name="ContactsListActivity$ContactsSearchActivity"
android:theme="@style/ContactsSearchTheme"
android:windowSoftInputMode="stateAlwaysVisible|adjustPan"
>
<intent-filter>
<action android:name="com.android.contacts.action.FILTER_CONTACTS" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/contact" android:host="com.android.contacts" />
</intent-filter>
</activity>
But the ContactsSearchActivity has no code.
public class ContactsListActivity extends ListActivity implements View.OnCreateContextMenuListener,
View.OnClickListener, View.OnKeyListener, TextWatcher, TextView.OnEditorActionListener,
OnFocusChangeListener, OnTouchListener {
public static class ContactsSearchActivity extends ContactsListActivity {
}
So i don’t understand if ContactsSearchActivity is called.(Full source)
2, The second is about search interface. I know activity which has
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"
is the activity handle query and display result. And the one has android:name=”android.app.default_searchable” is enabled search + point to search handle activity.
<meta-data
android:name="android.app.default_searchable"
android:value=".ContactsListActivity" />
But again in Contacts’s manifest, SearchResultsActivity is empty class extended from ContactsListActivity.
<!-- The contacts search/filter UI -->
<activity android:name="SearchResultsActivity"
android:theme="@style/TallTitleBarTheme"
android:label="@string/contactsList"
>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"
/>
</activity>
and
<meta-data
android:name="android.app.default_searchable"
android:value=".ContactsListActivity" />
in application tag not activity tag (link).
I want to understand these because i don’t know how to display this
instead of 
Thanks in advance and sorry for long question.
Edit: It’s ok with part1. In part 2, I want to display a custom diaglog when press search button but now i can only archive result in second image.
I change my code and achieve my custom search dialog.