From: Gustavo Martin Morcuende Date: Sat, 3 Sep 2016 05:28:04 +0000 (+0200) Subject: MapProgressFragment, avoid deprecated method X-Git-Tag: weatherinformation-2.0~13 X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=9478cce3f58f3b4217edd7f4f050d144b067c1df;p=AndroidWeatherInformation MapProgressFragment, avoid deprecated method --- diff --git a/app/src/main/java/name/gumartinm/weather/information/fragment/map/MapProgressFragment.java b/app/src/main/java/name/gumartinm/weather/information/fragment/map/MapProgressFragment.java index 4142f4c..eb29856 100644 --- a/app/src/main/java/name/gumartinm/weather/information/fragment/map/MapProgressFragment.java +++ b/app/src/main/java/name/gumartinm/weather/information/fragment/map/MapProgressFragment.java @@ -15,11 +15,6 @@ */ package name.gumartinm.weather.information.fragment.map; -import java.io.IOException; -import java.util.List; -import java.util.Locale; - -import android.app.Activity; import android.content.Context; import android.location.Address; import android.location.Geocoder; @@ -30,6 +25,10 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import java.io.IOException; +import java.util.List; +import java.util.Locale; + import name.gumartinm.weather.information.R; import name.gumartinm.weather.information.model.WeatherLocation; import timber.log.Timber; @@ -45,7 +44,7 @@ public class MapProgressFragment extends Fragment { * Callback interface through which the fragment will report the * task's progress and results back to the Activity. */ - public static interface TaskCallbacks { + public interface TaskCallbacks { void onPostExecute(final WeatherLocation weatherLocation); } @@ -85,9 +84,9 @@ public class MapProgressFragment extends Fragment { * each configuration change. */ @Override - public void onAttach(final Activity activity) { - super.onAttach(activity); - mCallbacks = (TaskCallbacks) activity; + public void onAttach(final Context context) { + super.onAttach(context); + mCallbacks = (TaskCallbacks) context; } /**