Skip to content

Commit

Permalink
Merge pull request #59 from addiittya2006/master
Browse files Browse the repository at this point in the history
EducateFragment Back button Fix
  • Loading branch information
addiittya2006 authored Aug 25, 2016
2 parents 6f82eea + 5645395 commit c269786
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,18 @@ public void run() {
view.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View view, int i, KeyEvent keyEvent) {
if(keyEvent.getAction() == KeyEvent.ACTION_UP) {
if (i == KeyEvent.KEYCODE_BACK) {
if (!searchView.isIconified()) {
if (!searchView.isIconified()) {
if(keyEvent.getAction() == KeyEvent.ACTION_UP) {
if (i == KeyEvent.KEYCODE_BACK) {
searchView.setQuery("", false);
searchItem.collapseActionView();
// rebuildIndex();
mArrArticle.clear();
mArrArticle.addAll(db.getAllArticles());
va.notifyDataSetChanged();
}
return true;
}
return true;
}
return false;
}
Expand Down Expand Up @@ -315,11 +315,10 @@ public void onResponse(JSONArray response) {

db.addNewArticles(mArrArticle);

rebuildIndex();

va.notifyDataSetChanged();

swipeRefreshLayout.setRefreshing(false);
rebuildIndex();
// swipeRefreshLayout.setRefreshing(false);

} catch (JSONException e) {
e.printStackTrace();
Expand Down

0 comments on commit c269786

Please sign in to comment.