N
N
Neonoviiwolf2016-12-13 02:16:04
Java
Neonoviiwolf, 2016-12-13 02:16:04

Explain why IDEA crossed out the line?

Good!
Actually, I set the text color in the adapter, I want it to use resources, it works, but I don’t understand why it looks like this
68e5d1c7af0045d88d5efa6e8188707b.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Michael Kim, 2016-12-13
@Neonoviiwolf

This is a deprecated method. Use ContextCompat.getColor(context, R.color.your_color);

A
Artyom Smirnov, 2016-12-13
@ArtFutureDev

IDEA highlights methods that oracle doesn't recommend using because of major flaws.

R
Rou1997, 2016-12-13
@Rou1997

This method is marked as deprecated in the annotations, as decided by Google, the author of the Android OS. They love it, the "watchman syndrome" and the syndrome of unfinished actions are the characteristic features of this ecosystem.
It's best to avoid using these methods, but it will compile, and will likely work, if the device is not on a very new OS version.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question