[and] Hide keyboard on start.
This commit is contained in:
parent
cc07c63d4d
commit
3b7d627939
2 changed files with 17 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue