L
L
LordPixel2015-12-28 00:08:42
Android
LordPixel, 2015-12-28 00:08:42

How to make the application work with all devices?

There is a getCurrectHour() method, but it has been replaced with getHour() in newer versions. How to make the first one work on the old ones and the second one on the new ones?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Dovnar, 2015-12-28
@LordPixel

We poke towards Build.VERSION :

if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {

} else {

}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question