437 |
DepartureList.this.getListView().setVisibility(View.VISIBLE); |
DepartureList.this.getListView().setVisibility(View.VISIBLE); |
438 |
|
|
439 |
|
|
440 |
|
// handle notification icon. |
441 |
if ( hasNotifications() ) { |
if ( hasNotifications() ) { |
442 |
findViewById(R.id.notifIcon).setVisibility(View.VISIBLE); |
View notifIcon = findViewById(R.id.notifIcon); |
443 |
} |
notifIcon.setVisibility(View.VISIBLE); |
444 |
|
notifIcon.setClickable(true); |
445 |
|
notifIcon.setOnClickListener( new View.OnClickListener() { |
446 |
|
@Override |
447 |
|
public void onClick(View v) { |
448 |
|
Intent i = new Intent(DepartureList.this, dk.thoerup.traininfo.NotificationList.class); |
449 |
|
i.putExtra(NotificationList.EXTRA_NOTIFICATIONS, departures.notifications); |
450 |
|
startActivity(i); |
451 |
|
} |
452 |
|
}); |
453 |
|
} |
454 |
|
|
455 |
if (departures.entries.size() == 0) { |
if (departures.entries.size() != 0) { |
456 |
MessageBox.showMessage(DepartureList.this, "No departures found", true); |
int msgId = (arrival==false) ? R.string.departurelist_nodepartures : R.string.departurelist_noarrivals; |
457 |
|
MessageBox.showMessage(DepartureList.this, getString(msgId), false); |
458 |
} |
} |
459 |
} else { // communication or parse error |
} else { // communication or parse error |
460 |
commFailCounter++; |
commFailCounter++; |