Code fragments are being struck out in Eclipse, why?

前端 未结 3 1937
离开以前
离开以前 2020-12-04 02:02

While I\'m making an Android app, Eclipse will strike out some things. More specifically, Gallery. Here is a screen shot:

3条回答
  •  离开以前
    2020-12-04 02:31

    (From the question before editing: The term is deprecated, not depreciated. It's a common typo, but worth being aware of for searching purposes :)

    It's basically a bit like "obsolete" - you're encouraged not to use classes or methods which are deprecated. Typically the documentation will explain why you're not meant to use them, and give you a better alternative. The deprecated version is only present for backward compatibility, usually.

    It's worth taking this seriously - a lot of the time if you're using a deprecated API, you're coming at something from a fundamentally flawed approach. Date is the clearest example of this, where the Java 1.0 API was almost entirely deprecated in 1.1, when Calendar was introduced. Using the deprecated methods in Date is a sure way of storing up problems for yourself.

    See the Oracle "How and when to deprecate APIs" page for more information.

提交回复
热议问题