File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
App/src/main/java/in/ac/dtu/subtlenews Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -105,18 +105,13 @@ public boolean onOptionsItemSelected(MenuItem item) {
105105 switch (id ){
106106 case R .id .action_refresh :
107107 new UpdateNews (MainActivity .this ).execute ();
108+ MainFragment mainFragment = (MainFragment ) getSupportFragmentManager ().findFragmentById (R .id .container );
109+ mainFragment .updateView ();
108110 return true ;
109111 case R .id .action_settings :
110112 return true ;
111113 }
112114 return super .onOptionsItemSelected (item );
113115 }
114116
115- /**
116- * A placeholder fragment containing a simple view.
117- */
118- public static class PlaceholderFragment extends Fragment {
119-
120- }
121-
122117}
Original file line number Diff line number Diff line change @@ -89,9 +89,13 @@ public void onAttach(Activity activity) {
8989 private static final String TAG_LINK = "link" ;
9090 private static final String TAG_DATE = "date" ;
9191
92+ public void updateView (){
93+ new ReadFromJSON ().execute ();
94+ }
95+
9296
9397
94- private class ReadFromJSON extends AsyncTask <Void , Void , ArrayList <JSONObject >> {
98+ public class ReadFromJSON extends AsyncTask <Void , Void , ArrayList <JSONObject >> {
9599
96100 @ Override
97101 protected ArrayList <JSONObject > doInBackground (Void ... v ) {
You can’t perform that action at this time.
0 commit comments