如何在android中使用Google dictionary
检查咒语?
我想知道我的单词类型是否正确。
它应该从Google dictionary
检查
如果这个词是正确的,那么它应该在烤面包中显示,否则它不应该显示
答案 0 :(得分:0)
@Override
public void onGetSuggestions(final SuggestionsInfo[] arg0) {
final StringBuilder sb = new StringBuilder();
boolean isSpellCorrect = false;
for (int i = 0; i < arg0.length; ++i) {
// Returned suggestions are contained in SuggestionsInfo
final int len = arg0[i].getSuggestionsCount();
if(editText1.getText().toString().equalsIgnoreCase(arg0[i].getSuggestionAt(i)))
{
isSpellCorrect = true;
Toast.makeText(this, "Entered word is correct", Toast.LENGTH_LONG).show();
break;
}
}
}
将此link用于整个项目,只需在上述方法中进行更改。