diff --git a/android/src/com/example/travelguide/ArticleInfoListFragment.java b/android/src/com/example/travelguide/ArticleInfoListFragment.java index 96502ca..bc7b76a 100644 --- a/android/src/com/example/travelguide/ArticleInfoListFragment.java +++ b/android/src/com/example/travelguide/ArticleInfoListFragment.java @@ -27,6 +27,7 @@ import android.widget.TextView; import com.example.travelguide.article.ArticleInfo; import com.example.travelguide.async.QueryResultLoader; import com.example.travelguide.cpp.Storage; +import com.example.travelguide.util.Utils; import com.example.travelguide.widget.StorageArticleInfoAdapter; import com.mapswithme.maps.api.MWMPoint; import com.mapswithme.maps.api.MapsWithMeApi; @@ -130,6 +131,13 @@ public class ArticleInfoListFragment extends ListFragment implements LoaderCallb public void onResume() { super.onResume(); + + checkLocation(); + Utils.hideKeyboard(getActivity()); + } + + private void checkLocation() + { if (System.currentTimeMillis() - sLastLocationRequestTime > LOCATION_UPDATE_INTERVAL) { // reqestSingleUpdate() listen for single update diff --git a/android/src/com/example/travelguide/util/Utils.java b/android/src/com/example/travelguide/util/Utils.java index 6c1f5cd..79838a2 100644 --- a/android/src/com/example/travelguide/util/Utils.java +++ b/android/src/com/example/travelguide/util/Utils.java @@ -2,9 +2,11 @@ package com.example.travelguide.util; import java.io.File; +import android.app.Activity; import android.content.Context; import android.os.Build; import android.view.View; +import android.view.WindowManager; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import android.view.animation.AnimationUtils; @@ -101,4 +103,11 @@ public class Utils return Build.VERSION.SDK_INT > version; } + public static void hideKeyboard(Activity activity) + { + activity + .getWindow() + .setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); + } + }