From f3bf89863fec03a7ff68e84ce177e1acdf933d5f Mon Sep 17 00:00:00 2001 From: DjBushido Date: Mon, 14 Apr 2014 14:01:48 -0400 Subject: [PATCH] App now actually downloads locations from the server. --- .../src/edu/uncc/scavenger/MainActivity.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/UNCCScavenger/src/edu/uncc/scavenger/MainActivity.java b/UNCCScavenger/src/edu/uncc/scavenger/MainActivity.java index 575f2da..4798fb7 100644 --- a/UNCCScavenger/src/edu/uncc/scavenger/MainActivity.java +++ b/UNCCScavenger/src/edu/uncc/scavenger/MainActivity.java @@ -2,20 +2,18 @@ package edu.uncc.scavenger; import java.util.List; -import edu.uncc.scavenger.database.LocationDatabaseClient; -import edu.uncc.scavenger.rest.LocationClient; -import edu.uncc.scavenger.rest.RestLocation; -import android.os.Bundle; import android.app.Activity; +import android.os.Bundle; import android.view.Menu; import android.view.View; import android.view.ViewGroup; -import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.ImageView; -import android.widget.ListAdapter; import android.widget.ListView; import android.widget.TextView; +import edu.uncc.scavenger.database.LocationDatabaseClient; +import edu.uncc.scavenger.rest.LocationClient; +import edu.uncc.scavenger.rest.RestLocation; public class MainActivity extends Activity { @@ -27,9 +25,9 @@ public class MainActivity extends Activity { setContentView(R.layout.activity_main); // Get our list of events loaded + locationList = (ListView)findViewById(R.id.listLocations); List locations = new LocationDatabaseClient().getAllLocations(); if (locations != null && locations.size() > 0) { - locationList = (ListView)findViewById(R.id.listLocations); LocationAdapter mLocationAdapter = new LocationAdapter(locations); locationList.setAdapter(mLocationAdapter); } else { @@ -52,7 +50,7 @@ public class MainActivity extends Activity { ((TextView)findViewById(R.id.txtNoLocations)).setVisibility(View.GONE); ((ListView)findViewById(R.id.listLocations)).setVisibility(View.VISIBLE); } - }; + }.execute(); } @Override