3
I am updating an Android application and I came across the following situation:
- I have a minimum sdk of 21 and target of 27.
- A method that has been deprecated version 24.
My question is this: what is the best course of action to correct an obsolete method?
- Replace old method with new?
Treat so that the old method performs its function for android versions prior to 24 and the new method performs the other versions? (a simple if/Else comparing mobile’s api versions to the method.)
if{versão atual > 24){ //Executa método novo. }else{ //Executa método antigo. }