Archived
Improved behaviour of back-button in case program was filtered by category.
This commit is contained in:
1 parent
27546d4903
commit
3c2fa188b5
1 file changed
+14
@@ -40,6 +40,8 @@ public class ProgramListActivity extends BaseDnsActivity {
|
||||
private XmlParser parser;
|
||||
private DataHandler dataHandler;
|
||||
|
||||
private String currentCategory = Event.ALL;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -77,6 +79,16 @@ public class ProgramListActivity extends BaseDnsActivity {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (currentCategory.equals(Event.ALL)) {
|
||||
super.onBackPressed();
|
||||
} else {
|
||||
ListCreator lc = new ListCreator(Event.ALL, false);
|
||||
lc.execute();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected ListAdapter createAdapter(String category) {
|
||||
Event[] events = dataHandler.populateList(category);
|
||||
@@ -225,6 +237,8 @@ public class ProgramListActivity extends BaseDnsActivity {
|
||||
|
||||
ProgressBar pb = (ProgressBar)findViewById(R.id.event_list_progress_bar);
|
||||
pb.setVisibility(View.GONE);
|
||||
|
||||
currentCategory = category;
|
||||
} else {
|
||||
Toast toast = Toast.makeText(ProgramListActivity.this, R.string.error_noconnection_noupdate, Toast.LENGTH_LONG);
|
||||
toast.show();
|
||||
|
||||
Reference in new issue
Block a user