【问题标题】:onAttach() in the compatibility library ListFragment兼容性库 ListFragment 中的 onAttach()
【发布时间】:2011-12-25 09:35:53
【问题描述】:

我想从兼容性库中重写 ListFragment 的 onAttach() http://developer.android.com/reference/android/app/Fragment.html#onAttach(android.app.Activity) 方法,但似乎找不到它... 我是不是搞错了,或者这个方法没有在兼容性库中实现,我将不得不覆盖另一个方法?列表

【问题讨论】:

    标签: android android-compatibility


    【解决方案1】:

    我试图覆盖:

    @Override
    public void onAttach(Activity activity) {
        // TODO Auto-generated method stub
        super.onAttach(activity);
    }
    

    我应该覆盖的地方:

    @Override
    public void onAttach(SupportActivity activity) {
        // TODO Auto-generated method stub
        super.onAttach(activity);
    }
    

    注意:第一种方法的“Activity”和第二种方法的:“SupportActivity”..

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-17
      • 2011-06-09
      • 2011-03-22
      • 1970-01-01
      • 2014-10-11
      • 1970-01-01
      • 2012-01-04
      • 1970-01-01
      相关资源
      最近更新 更多