I'm updating an Android application and I came across the following situation:
- I have a minimum sdk of 21 and a target of 27.
- A method that was obsolete version 24.
My question is: what is the best way to fix an obsolete method?
- Replace old method with new?
-
Try to have the old method perform its function for android versions prior to 24 and the new method make the other versions? (a simple if / else comparing the api versions of the cell to that of the method.)
if{versão atual > 24){ //Executa método novo. }else{ //Executa método antigo. }