Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions app/src/org/commcare/dalvik/activities/CommCareSetupActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public enum UiState { advanced, basic, ready, error, upgrade};
boolean resourceTableWasFresh;
static final long START_OVER_THRESHOLD = 604800000; //1 week in milliseconds


private BroadcastReceiver purgeNotificationReceiver = null;

@Override
public void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -288,12 +288,13 @@ public void onClick(View v) {

// Hide "See More" button when notification is cleared
// (by any method: button press, viewing from drawer, or clearing from drawer)
registerReceiver(new BroadcastReceiver() {
purgeNotificationReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
viewNotificationButton.setVisibility(View.GONE);
}
}, new IntentFilter(CommCareApplication.ACTION_PURGE_NOTIFICATIONS));
};
registerReceiver(purgeNotificationReceiver, new IntentFilter(CommCareApplication.ACTION_PURGE_NOTIFICATIONS));

// "See More" launches standard notification-viewing activity
viewNotificationButton.setOnClickListener(new OnClickListener() {
Expand Down Expand Up @@ -356,6 +357,13 @@ public void onGlobalLayout() {

}

@Override
public void onDestroy() {
if (purgeNotificationReceiver != null) {
unregisterReceiver(purgeNotificationReceiver);
}
}

public void refreshView(){

switch(uiState){
Expand Down