Skip to content Skip to sidebar Skip to footer

Search The Inbox Content By Given String

I want to develop an application, the small part of which will search the string of message from an EditText in the Inbox of my device.... I have referred some links like Search sm

Solution 1:

I finally got the answer but dont know if its the most efficient solution. Kindly correct me if there is some more efficient solution.

I first checked a particular text from Inbox to the text I inserted in Search Box. And if the text matches then I inserted it into the ArrayList. Finally I print whole ArrayList.

publicArrayList<String> check(String str)
{

    boolean fullContainsSub = str.toUpperCase().indexOf(content.toUpperCase()) != -1;
    //String styledText = "This is <font color='red'>simple</font>.";//item.setText(Html.fromHtml(styledText), ListView.BufferType.SPANNABLE);if(fullContainsSub)
    {
     itemList.add(str);
    }
    return itemList;
}

Here str is text from Inbox while content will be search box text.

Post a Comment for "Search The Inbox Content By Given String"