'Creating a Search Interface in a Android with Kotlin

I am having a hard time figuring out the documentation on creating a search Interface. My main activity contains the search widget on the app bar but when I perform a search query it does not launch the Searchable Activity; responsible for displaying the results.

Below is my manifest file for the SearchbaleActivity and MainActivity

<activity
        android:name=".activities.SearchableActivity"
        android:exported="false"
        android:label="@string/title_activity_searchable"
        android:theme="@style/Theme.MoveApplication.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data android:name="android.app.searchable"
            android:resource="@xml/searchable"/>
    </activity>

<activity
        android:name=".activities.MainActivity"
        android:exported="false" >

    </activity>

Should my intent-filter and meta-data attributes be in my MainActivity or SearchableActivity? And even so, my SearchableActivity should launch despite not handling the query, right?

My Android skills are not that great so i'll appreciate a vivid explanation with examples



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source