Skip to content

Commit

Permalink
Unregister click listener onStop
Browse files Browse the repository at this point in the history
- Change Constants class to interface instead of abstract class
  • Loading branch information
ekigamba committed Mar 14, 2019
1 parent f41690f commit 887460b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,12 @@ protected void onStart() {
super.onStart();
initializePresenter();

sendButton.setOnClickListener(null);
receiveButton.setOnClickListener(null);

sendButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
presenter.onSendButtonClicked();
}
});

receiveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down Expand Up @@ -307,6 +303,8 @@ public boolean removeOnActivityRequestPermissionHandler(@NonNull OnActivityReque
protected void onStop() {
super.onStop();

sendButton.setOnClickListener(null);
receiveButton.setOnClickListener(null);

presenter.onStop();
}
Expand Down
10 changes: 5 additions & 5 deletions p2p-sync/src/main/java/org/smartregister/p2p/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* Created by Ephraim Kigamba - ekigamba@ona.io on 11/03/2019
*/

public abstract class Constants {
public interface Constants {

public static final Strategy STRATEGY = Strategy.P2P_STAR;
Strategy STRATEGY = Strategy.P2P_STAR;

public abstract static class RQ_CODE {
public static final int PERMISSIONS = 2;
public static final int LOCATION_SETTINGS = 3;
interface RQ_CODE {
int PERMISSIONS = 2;
int LOCATION_SETTINGS = 3;
}
}

0 comments on commit 887460b

Please sign in to comment.