KousiK
KousiK

Reputation: 825

Can I use Deprecated methods?

Are there any disadvantages to using deprecated methods in my code?

For example, I am using view.setBackgroundDrawable(background) in api 19 and it's working fine, but I want to know the proper way.

Upvotes: 1

Views: 612

Answers (1)

Heinzi
Heinzi

Reputation: 172220

The main disadvantage is that the API might not be available in future versions, which will increase the cost of updating your application. It's also an indication that the SDK developers believe that there is a "better way" to do what you want to do.

Thus, in the end, it's a cost/value tradeoff: If the deprecated method is easy to replace, use the replacement. If it isn't, it's up to you to decide whether developing the "future-proof" way is worth the additional effort.

For example:

Upvotes: 9

Related Questions