android.app.Fragment已过时

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xfhy_/article/details/83176223

今天早上使用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 {}

猜你喜欢

转载自blog.csdn.net/xfhy_/article/details/83176223