mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Add check to only read 10 lines
This commit is contained in:
parent
3809c1fdbd
commit
55810cd050
2 changed files with 8 additions and 1 deletions
|
|
@ -47,6 +47,7 @@ public class NearbyListFragment extends ListFragment {
|
|||
//Load from data source (NearbyPlaces.java)
|
||||
places = loadAttractionsFromLocation(mLatestLocation);
|
||||
|
||||
/*
|
||||
// Create a progress bar to display while the list loads
|
||||
ProgressBar progressBar = new ProgressBar(getActivity());
|
||||
progressBar.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
|
|
@ -56,6 +57,7 @@ public class NearbyListFragment extends ListFragment {
|
|||
// Must add the progress bar to the root of the layout
|
||||
ViewGroup root = (ViewGroup) view.getRootView();
|
||||
root.addView(progressBar);
|
||||
*/
|
||||
|
||||
mAdapter = new NearbyAdapter(getActivity(), places);
|
||||
setListAdapter(mAdapter);
|
||||
|
|
|
|||
|
|
@ -31,8 +31,13 @@ public class NearbyPlaces {
|
|||
|
||||
boolean firstLine = true;
|
||||
String line;
|
||||
while ((line = in.readLine()) != null) {
|
||||
int counter = 0;
|
||||
|
||||
//while ((line = in.readLine()) != null) {
|
||||
while (in.readLine() != null && counter < 11) {
|
||||
|
||||
line = in.readLine();
|
||||
counter++;
|
||||
// Skip CSV header.
|
||||
if (firstLine) {
|
||||
firstLine = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue