Search code examples
androidsearchandroid-intentevernote

Search Intent in Android (for Evernote)


I was trying to create an intent in Android that would search in the Evernote app for a specific keyword, but the documentation that the Evernote site mentions doesn't seem to be available, so I tried writing it on my own, but it doesn't seem to work. This is what I have now:

final String ACTION_EVERNOTE = "com.evernote.action.SEARCH_NOTES";
String KEYWORD = "hoi";
Intent i = new Intent();
i.setAction(ACTION_EVERNOTE);
i.putExtra(Intent.ACTION_SEARCH, KEYWORD);
startActivity(i);

Does anyone have an idea what is going wrong here? Right now it just performs a search with an asterisk, which is the default, so it probably just ignores the ACTION_SEARCH part. Is there an error in that part of my intent?

Thanks in advance!


Solution

  • Try it like this, with the String called QUERY, as it's called in the SearchManager documentation:

    final String ACTION_EVERNOTE = "com.evernote.action.SEARCH_NOTES";
    String QUERY = "hoi";
    Intent i = new Intent();
    i.setAction(ACTION_EVERNOTE);
    i.putExtra(Intent.ACTION_SEARCH, QUERY);
    startActivity(i);