Skip to content

Instantly share code, notes, and snippets.

View afrinjamanbd's full-sized avatar
🔆
Google Summer of Code Winner 2019

Afrin Jaman afrinjamanbd

🔆
Google Summer of Code Winner 2019
View GitHub Profile
package com.mako.companyname;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.FragmentActivity;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
@afrinjamanbd
afrinjamanbd / newActivityFromSearchView.md
Created January 21, 2019 16:34 — forked from vxhviet/newActivityFromSearchView.md
Start new activity from SearchView

Source: StackOverflow

This answer is a little late but I feel it'll be useful for future viewers. The dilemma seems to come from the ambiguity of the Android SearchView tutorial. The scenario they cover assumes you will be displaying the results in the same Activity the SearchView resides. In such a scenario, the Activity tag in the AndroidManifest.xml file would look something like this:

<activity
    android:name=".MainActivity"
    android:label="@string/main_activity_label"
    android:launchMode="singleTop">
        <intent-filter>