1
嗨,我正在使用特定关键字在应用程序中执行搜索操作,并列出结果列表视图活动。结果将在搜索关键字前后显示50个字符,但是当我用50个字符打破单词时,结果中的半字或单个字母显示在开头和结尾。我怎么能忽略并得到完整的单词android应用程序搜索操作与破碎的单词
以下是我的代码。请帮助我做到这一点。在此先感谢
int endindex = searchTextStartIndex + searchTextLength + 50;
if (searchTextStartIndex > 50) {
startindex = searchTextStartIndex - 50;
}
if (endindex > datalength) {
endindex = datalength;
}
searchdata = searchdata.substring(startindex, endindex);
} catch (Exception e)
非常感谢,这是又一个伟大的help..thanks – Jes