Android 按给定字符串搜索收件箱内容
我想开发一个应用程序,其中的一小部分将搜索我设备收件箱中编辑文本中的消息字符串 我提到了一些链接,如 但无法使之成为可能。。。Android 按给定字符串搜索收件箱内容,android,search,full-text-search,sms,Android,Search,Full Text Search,Sms,我想开发一个应用程序,其中的一小部分将搜索我设备收件箱中编辑文本中的消息字符串 我提到了一些链接,如 但无法使之成为可能。。。 有人能帮我写一段有用的代码吗…提前谢谢。我终于得到了答案,但不知道这是否是最有效的解决方案。如果有更有效的解决方案,请指正 我首先从收件箱中选择了一个特定的文本,并将其插入到搜索框中。如果文本匹配,我就把它插入ArrayList。最后我打印了整个ArrayList public ArrayList<String> check(String str)
有人能帮我写一段有用的代码吗…提前谢谢。我终于得到了答案,但不知道这是否是最有效的解决方案。如果有更有效的解决方案,请指正 我首先从收件箱中选择了一个特定的文本,并将其插入到搜索框中。如果文本匹配,我就把它插入ArrayList。最后我打印了整个ArrayList
public ArrayList<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;
}
公共数组列表检查(字符串str)
{
布尔值fullContainsSub=str.toUpperCase().indexOf(content.toUpperCase())!=-1;
//String styledText=“这很简单。”;
//item.setText(Html.fromHtml(styledText),ListView.BufferType.SPANNABLE);
if(fullContainsSub)
{
itemList.add(str);
}
返回项目列表;
}
这里str是来自收件箱的文本,而内容将是搜索框文本。我终于得到了答案,但不知道这是否是最有效的解决方案。如果有更有效的解决方案,请指正 我首先从收件箱中选择了一个特定的文本,并将其插入到搜索框中。如果文本匹配,我就把它插入ArrayList。最后我打印了整个ArrayList
public ArrayList<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;
}
公共数组列表检查(字符串str)
{
布尔值fullContainsSub=str.toUpperCase().indexOf(content.toUpperCase())!=-1;
//String styledText=“这很简单。”;
//item.setText(Html.fromHtml(styledText),ListView.BufferType.SPANNABLE);
if(fullContainsSub)
{
itemList.add(str);
}
返回项目列表;
}
这里str是收件箱中的文本,而内容将是搜索框文本。请参阅我的评论以获取答案…请参阅我的评论以获取答案。。。