Skip to content

Commit

Permalink
Merge pull request #18 from OmniaAlam/dev/OmniaA
Browse files Browse the repository at this point in the history
#1 Replace this "switch" statement by "if" statements to increase readability.
  • Loading branch information
OmniaAlam authored Feb 14, 2024
2 parents 41f171a + bc77b88 commit f7e2b78
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ public TrackDeleteResultReceiver(Handler handler, @NonNull Receiver receiver) {

@Override
protected void onReceiveResult(int resultCode, Bundle resultData) {
switch (resultCode) {
case RESULT_CODE_SUCCESS -> receiver.onDeleteFinished();
default -> throw new RuntimeException("Unknown resultCode.");
}

if(resultCode==RESULT_CODE_SUCCESS){
receiver.onDeleteFinished();
}
else{
throw new IllegalArgumentException("Unknown resultCode.");
}

}

public interface Receiver {
Expand Down

0 comments on commit f7e2b78

Please sign in to comment.