diff --git a/res/values/strings.xml b/res/values/strings.xml index a34a310..e3924f4 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -58,4 +58,5 @@ Find who else is attending the UNCC football game! \n \nEnter the name of a person or organization into the search bar above. Refresh Alerts RSVP Search + Internet access is currently unavailable. diff --git a/src/com/uncc/gameday/activities/Registration.java b/src/com/uncc/gameday/activities/Registration.java index aa4a3a3..4f8c536 100644 --- a/src/com/uncc/gameday/activities/Registration.java +++ b/src/com/uncc/gameday/activities/Registration.java @@ -1,13 +1,15 @@ package com.uncc.gameday.activities; +import retrofit.RetrofitError; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; -import android.os.Bundle; -import android.view.View; import android.content.DialogInterface.OnClickListener; -import android.widget.Button; +import android.os.Bundle; +import android.util.Log; +import android.view.View; import android.widget.TextView; +import android.widget.Toast; import com.uncc.gameday.R; import com.uncc.gameday.registration.Attendee; @@ -22,7 +24,6 @@ public class Registration extends MenuActivity { * @see com.uncc.gameday.activities.MenuActivity#onCreate(android.os.Bundle) */ - private Button b; private TextView t; @@ -115,8 +116,13 @@ public class Registration extends MenuActivity { } public void run() { - RegistrationClient client = new RegistrationClient(c); - client.registerAttendee(a); + try { + RegistrationClient client = new RegistrationClient(c); + client.registerAttendee(a); + } catch (RetrofitError e) { + Toast.makeText(c, R.string.internet_down_error, Toast.LENGTH_SHORT).show(); + Log.e("Registration", e.getLocalizedMessage()); + } } } } diff --git a/src/com/uncc/gameday/activities/Search.java b/src/com/uncc/gameday/activities/Search.java index 0dfeb0f..cb196d2 100644 --- a/src/com/uncc/gameday/activities/Search.java +++ b/src/com/uncc/gameday/activities/Search.java @@ -2,8 +2,12 @@ package com.uncc.gameday.activities; import java.util.List; +import retrofit.RetrofitError; + import android.content.Context; import android.os.Bundle; +import android.util.Log; +import android.widget.Toast; import com.uncc.gameday.R; import com.uncc.gameday.registration.Attendee; @@ -28,9 +32,14 @@ public class Search extends MenuActivity { } public void run() { - RegistrationClient client = new RegistrationClient(this.c); - rsvpList = client.listAttendees(); - listFetched = true; + try { + RegistrationClient client = new RegistrationClient(this.c); + rsvpList = client.listAttendees(); + listFetched = true; + } catch (RetrofitError e) { + Toast.makeText(c, R.string.internet_down_error, Toast.LENGTH_SHORT).show(); + Log.e("Search", e.getLocalizedMessage()); + } } } diff --git a/src/com/uncc/gameday/activities/parking/LotViewFragment.java b/src/com/uncc/gameday/activities/parking/LotViewFragment.java index 090fa41..35b3a65 100644 --- a/src/com/uncc/gameday/activities/parking/LotViewFragment.java +++ b/src/com/uncc/gameday/activities/parking/LotViewFragment.java @@ -2,7 +2,6 @@ package com.uncc.gameday.activities.parking; import android.app.DialogFragment; import android.os.Bundle; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; @@ -17,7 +16,6 @@ import com.uncc.gameday.parking.ParkingClient; import com.uncc.gameday.parking.ParkingLot; import com.uncc.gameday.parking.RatingChoices; -// TODO: Auto-generated Javadoc /** * The Class LotViewFragment. */ @@ -71,8 +69,6 @@ public class LotViewFragment extends DialogFragment { view.findViewById(R.id.lotViewSubmitRating).setOnClickListener(new SubmitListener(this)); - if (view == null) - Log.e("LotViewFragment", "Unable to instantiate view!"); return view; } @@ -144,7 +140,6 @@ public class LotViewFragment extends DialogFragment { @Override public void onClick(View v) { - // TODO Auto-generated method stub f.onSubmitRating(v); } }