今天早上使用Fragment时,忽然发现,android.app.Fragment已经过时了…
/**
* @deprecated Use the <a href="{@docRoot}tools/extras/support-library.html">Support Library</a>
* {@link android.support.v4.app.Fragment} for consistent behavior across all devices
* and access to <a href="{@docRoot}topic/libraries/architecture/lifecycle.html">Lifecycle</a>.
*/
@Deprecated
public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListener {}
官方建议使用android.support.v4.app.Fragment
来替代.
还有就是:android.app.FragmentManager也是过时了…官方建议使用import android.support.v4.app.FragmentManager;
/**
* @deprecated Use the <a href="{@docRoot}tools/extras/support-library.html">Support Library</a>
* {@link android.support.v4.app.FragmentManager} for consistent behavior across all devices
* and access to <a href="{@docRoot}topic/libraries/architecture/lifecycle.html">Lifecycle</a>.
*/
@Deprecated
public abstract class FragmentManager {}