Skip to content

Commit

Permalink
#1 Replace Switch with If Statment
Browse files Browse the repository at this point in the history
  • Loading branch information
OmniaAlam committed Feb 11, 2024
1 parent f3f9ad2 commit a2c0539
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ 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 RuntimeException("Unknown resultCode.");
}

}

public interface Receiver {
void onDeleteFinished();
}
Expand Down

0 comments on commit a2c0539

Please sign in to comment.