mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-25 09:30:32 +00:00
fixed toast issue of the previous commit
This commit is contained in:
parent
8048ad343e
commit
7195ff349b
@ -171,12 +171,10 @@ public class VideoItemListActivity extends AppCompatActivity
|
|||||||
ArrayList<String>suggestions = engine.suggestionList(query,searchLanguage,new Downloader());
|
ArrayList<String>suggestions = engine.suggestionList(query,searchLanguage,new Downloader());
|
||||||
h.post(new SuggestionResultRunnable(suggestions));
|
h.post(new SuggestionResultRunnable(suggestions));
|
||||||
} catch (ExtractionException e) {
|
} catch (ExtractionException e) {
|
||||||
Toast.makeText(VideoItemListActivity.this, getString(R.string.parsing_error),
|
postNewErrorToast(h, R.string.parsing_error);
|
||||||
Toast.LENGTH_SHORT).show();
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Toast.makeText(VideoItemListActivity.this, getString(R.string.network_error),
|
postNewErrorToast(h, R.string.network_error);
|
||||||
Toast.LENGTH_SHORT).show();
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -378,4 +376,14 @@ public class VideoItemListActivity extends AppCompatActivity
|
|||||||
searchThread.start();
|
searchThread.start();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void postNewErrorToast(Handler h, final int stringResource) {
|
||||||
|
h.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Toast.makeText(VideoItemListActivity.this, getString(stringResource),
|
||||||
|
Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user