Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FitnessActivities.getName(int i) method is deprecated, what method to use instead?

In the following library: com.google.android.gms:play-services-fitness:9.8.0

In the following class: com.google.android.gms.fitness.FitnessActivities

There is this method: public static java.lang.String getName(int i)

However, in the library com.google.android.gms:play-services-fitness:10.2.0 the above mentioned method is removed.

What method to use instead of the above mentioned method?

like image 371
NickUnuchek Avatar asked Mar 13 '17 08:03

NickUnuchek


1 Answers

Can you give us some code? I assume that you have a variable with value X and you want to perform some actions according to this value. If that is the case, I will do that with a switch statement:

switch(myFitnessValue) {
case FitnessActivities.AEROBICS:
    doAerobics();
break;

case FitnessActivities.BIKING:
    doBiking();
break;

case FitnessActivities.WALKING:
    doWalking();
break;

default:
    doNothing();
}
like image 135
Alberto Alegria Avatar answered Nov 11 '22 17:11

Alberto Alegria