本文整理汇总了Java中com.google.android.apps.iosched.io.model.SearchSuggestions类的典型用法代码示例。如果您正苦于以下问题:Java SearchSuggestions类的具体用法?Java SearchSuggestions怎么用?Java SearchSuggestions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SearchSuggestions类属于com.google.android.apps.iosched.io.model包,在下文中一共展示了SearchSuggestions类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import com.google.android.apps.iosched.io.model.SearchSuggestions; //导入依赖的package包/类
public ArrayList<ContentProviderOperation> parse(String json)
throws IOException {
final ArrayList<ContentProviderOperation> batch = Lists.newArrayList();
SearchSuggestions suggestions = new Gson().fromJson(json, SearchSuggestions.class);
if (suggestions.words != null) {
// Clear out suggestions
batch.add(ContentProviderOperation
.newDelete(ScheduleContract.addCallerIsSyncAdapterParameter(
ScheduleContract.SearchSuggest.CONTENT_URI))
.build());
// Rebuild suggestions
for (String word : suggestions.words) {
batch.add(ContentProviderOperation
.newInsert(ScheduleContract.addCallerIsSyncAdapterParameter(
ScheduleContract.SearchSuggest.CONTENT_URI))
.withValue(SearchManager.SUGGEST_COLUMN_TEXT_1, word)
.build());
}
}
return batch;
}