diff --git a/app/src/main/java/com/javiersantos/mlmanager/activities/MainActivity.java b/app/src/main/java/com/javiersantos/mlmanager/activities/MainActivity.java index c08ff79..a50d8fd 100644 --- a/app/src/main/java/com/javiersantos/mlmanager/activities/MainActivity.java +++ b/app/src/main/java/com/javiersantos/mlmanager/activities/MainActivity.java @@ -263,7 +263,9 @@ protected void onPostExecute(Void aVoid) { setPullToRefreshView(pullToRefreshView); drawer.closeDrawer(); drawer = UtilsUI.setNavigationDrawer((Activity) context, context, toolbar, appAdapter, appSystemAdapter, appFavoriteAdapter, appHiddenAdapter, recyclerView); - } + + pullToRefreshView.setRefreshing(false); + } } @@ -271,16 +273,14 @@ private void setPullToRefreshView(final PullToRefreshView pullToRefreshView) { pullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() { @Override public void onRefresh() { - appAdapter.clear(); - appSystemAdapter.clear(); - appFavoriteAdapter.clear(); - recyclerView.setAdapter(null); - new getInstalledApps().execute(); - pullToRefreshView.postDelayed(new Runnable() { @Override public void run() { - pullToRefreshView.setRefreshing(false); + appAdapter.clear(); + appSystemAdapter.clear(); + appFavoriteAdapter.clear(); + recyclerView.setAdapter(null); + new getInstalledApps().execute(); } }, 2000); }