What does “This method is deprecated” mean for application developers

后端 未结 5 1392
[愿得一人]
[愿得一人] 2020-12-01 11:59

I see quite a few good old useful methods or even entire classes being \"deprecated and obsolete\".

But code that used to call those methods continues to work. So,

5条回答
  •  执念已碎
    2020-12-01 12:26

    I would go with 4:

    It will basically tell you that the use of the method or class is discouraged; it is NOT 100% that they will keep backward compatibility (they can decide to not include that method in future releases), so you should try to use the replacement of the method or class. This is sometimes not possible to use the new methods (for instance, if you want to support devices running older versions).

    Some other times it is actually possible. For instance, the showDialog method is now deprecated and they recommend to use DialogFragment class. You can achieve that even in older versions of Android by using the compatibility library.

提交回复
热议问题