Example usage for android.content Intent ACTION_SEARCH

List of usage examples for android.content Intent ACTION_SEARCH

Introduction

In this page you can find the example usage for android.content Intent ACTION_SEARCH.

Prototype

String ACTION_SEARCH

To view the source code for android.content Intent ACTION_SEARCH.

Click Source Link

Document

Activity Action: Perform a search.

Usage

From source file:SearchResultActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_search_result);
    mTextViewSearchResult = (TextView) findViewById(R.id.textViewSearchResult);

    if (Intent.ACTION_SEARCH.equals(getIntent().getAction())) {
        handleSearch(getIntent().getStringExtra(SearchManager.QUERY));
    }/*from w ww .j av a 2s .  c  o  m*/
}

From source file:SearchResultActivity.java

@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    if (Intent.ACTION_SEARCH.equals(getIntent().getAction())) {
        handleSearch(intent.getStringExtra(SearchManager.QUERY));
    }//from   ww w. j a  va2s  . c  o  m
}

From source file:org.maikelwever.droidpile.SearchActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_search);
    MailListFragment fragment = new MailListFragment();
    if (Intent.ACTION_SEARCH.equals(getIntent().getAction())) {
        fragment.setSearchQuery(getIntent().getStringExtra(SearchManager.QUERY));
    } else {/*from   www  . ja  v a  2s .  c  om*/
        Bundle b = getIntent().getExtras();
        if (b.containsKey("previousSearch")) {
            fragment.setSearchQuery(b.getString("previousSearch"));
        }
    }
    getSupportFragmentManager().beginTransaction().add(R.id.searchViewGroup, fragment).commit();
}

From source file:uk.bcu.ItunesSearchableActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.search);//  w  ww .j a v  a  2  s  . c o m
    searchResults = new ArrayList<JSONObject>();

    Intent intent = getIntent();
    if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
        String query = intent.getStringExtra(SearchManager.QUERY);
        doSearch(query);
    }
}

From source file:uk.bcu.SearchableActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.search);// w  w  w .j  av  a2  s  . c  o m
    searchResults = new ArrayList<JSONObject>();

    //Get the intent, verify the action and get the query
    Intent intent = getIntent();
    if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
        String query = intent.getStringExtra(SearchManager.QUERY);
        doSearch(query);
    }
}

From source file:org.barbon.mangaget.SearchTest.java

public Intent searchIntent(String query) {
    Context targetContext = getInstrumentation().getTargetContext();
    Intent intent = new Intent(targetContext, MangaSearch.class);

    intent.setAction(Intent.ACTION_SEARCH);
    intent.putExtra(SearchManager.QUERY, query);

    return intent;
}

From source file:fr.outadev.skinswitch.GallerySearchActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    if (Intent.ACTION_SEARCH.equals(getIntent().getAction())) {
        String query = getIntent().getStringExtra(SearchManager.QUERY);

        Bundle args = new Bundle();
        args.putString(GalleryPageFragment.ARG_SEARCH_QUERY, query);
        args.putSerializable(GalleryPageFragment.ARG_ENDPOINT,
                SkinManagerConnectionHandler.EndPoint.SEARCH_SKINS);

        Fragment searchFrag = new GalleryPageFragment();
        searchFrag.setArguments(args);//from  w w  w .  j a  v  a  2s. c  om
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.add(android.R.id.content, searchFrag).commit();
    }
}

From source file:com.miz.mizuu.MovieDetails.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Set theme// ww  w.j  a  v a 2s. com
    setTheme(R.style.Mizuu_Theme_NoBackground);

    ViewUtils.setupWindowFlagsForStatusbarOverlay(getWindow(), true);

    setTitle(null);

    // Fetch the database ID of the movie to view
    if (Intent.ACTION_SEARCH.equals(getIntent().getAction())) {
        mMovieId = getIntent().getStringExtra(SearchManager.EXTRA_DATA_KEY);
    } else {
        mMovieId = getIntent().getExtras().getString("tmdbId");
    }

    Fragment frag = getSupportFragmentManager().findFragmentByTag(TAG);
    if (frag == null) {
        final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.add(android.R.id.content, MovieDetailsFragment.newInstance(mMovieId), TAG);
        ft.commit();
    }
}

From source file:com.miz.mizuu.TvShowDetails.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Set theme/*from  w  ww  . j  av  a 2 s . c o  m*/
    setTheme(R.style.Mizuu_Theme_NoBackground);

    ViewUtils.setupWindowFlagsForStatusbarOverlay(getWindow(), true);

    setTitle(null);

    // Fetch the database ID of the TV show to view
    if (Intent.ACTION_SEARCH.equals(getIntent().getAction())) {
        mShowId = getIntent().getStringExtra(SearchManager.EXTRA_DATA_KEY);
    } else {
        mShowId = getIntent().getStringExtra("showId");
    }

    Fragment frag = getSupportFragmentManager().findFragmentByTag(TAG);
    if (frag == null) {
        final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.add(android.R.id.content, TvShowDetailsFragment.newInstance(mShowId), TAG);
        ft.commit();
    }
}

From source file:com.gnufabio.costituzione.SearchResultsActivity.java

@Override
public void onCreate(Bundle instance) {
    super.onCreate(instance);
    Intent callingIntent = getIntent();//from   w w  w .  j av a  2s .c o m

    fm = getSupportFragmentManager();
    if (callingIntent.getAction().equals(Intent.ACTION_SEARCH)) {
        String keyword = callingIntent.getStringExtra(SearchManager.QUERY);
        int category = callingIntent.getIntExtra(Constants.EXTRA_CATEGORY, -1);

        refresh(keyword, category);
    }
}