fix legwork suggestions parser
This commit is contained in:
parent
3cd9e0d4d2
commit
a880891cf2
@ -35,11 +35,11 @@ public final class LegworkSuggestionsModel extends BaseSuggestionsModel {
|
||||
@Override
|
||||
protected void parseResults(@NonNull InputStream inputStream, @NonNull List<HistoryItem> results) throws Exception {
|
||||
String content = FileUtils.readStringFromStream(inputStream, ENCODING);
|
||||
JSONArray jsonArray = new JSONArray(content);
|
||||
JSONArray respArray = new JSONArray(content);
|
||||
JSONArray jsonArray = respArray.getJSONArray(1);
|
||||
int counter = 0;
|
||||
for (int n = 0, size = jsonArray.length(); n < size; n++) {
|
||||
JSONObject object = jsonArray.getJSONObject(n);
|
||||
String suggestion = object.getString("phrase");
|
||||
String suggestion = jsonArray.getString(n);
|
||||
results.add(new HistoryItem(mSearchSubtitle + " \"" + suggestion + '"',
|
||||
suggestion, R.drawable.ic_search));
|
||||
counter++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user