小编fly*_*ant的帖子

哪里可以找到有关Android Studio中过时API的调试信息?

在AS版本3.3中,我们现在可以在gradle.properties文件中设置android.debug.obsoleteApi=true标志,这样我们就可以看到不再支持的API调用.

根据AS博客上 的文章,它现在可以提供更详细的信息,以帮助您确定API的使用位置

我的问题是,我在哪里可以找到这种信息?我查看了构建检查结果窗口,但我找不到任何有关过时API调用的信息.

android android-studio

5
推荐指数
1
解决办法
2586
查看次数

在MiniControllerFragment中调用super.onCreateView()时出现NullPointerException

在我的应用程序中,我正在尝试实现一个MiniControlFragment,它会在用户决定关闭时显示ExpandedControlsActivity(Mini控制器的全屏版本).我没有以声明方式将其添加到xml布局中,而是需要以编程方式执行此操作.

所以我创建了自己的类,扩展了MiniControllerFragment:

public class CastControllingFragment extends MiniControllerFragment
{
    @Override
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle)
    {
        View view = super.onCreateView(layoutInflater, viewGroup, bundle);
        if (view != null) {
            FrameLayout.LayoutParams frameLayoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            view.setLayoutParams(frameLayoutParams);
        }
        return view;
    }

    public static void show(FragmentActivity activity) {
        FragmentManager fragmentManager = activity.getSupportFragmentManager();
        if (fragmentManager.findFragmentById(R.id.castMiniController) == null)
        {
            View rootView = activity.findViewById(R.id.fragment_container);
            if (rootView instanceof ViewGroup)
            {                    
               fragmentManager.beginTransaction().add(R.id.fragment_container, new CastControllingFragment()).commit();
            }
        }
    }

}
Run Code Online (Sandbox Code Playgroud)

我实例并把它添加到片段中的交易Activity的 …

android nullpointerexception google-cast

1
推荐指数
1
解决办法
515
查看次数