Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android注释@Afterview调用了3次_Android_Android Annotations - Fatal编程技术网

Android注释@Afterview调用了3次

Android注释@Afterview调用了3次,android,android-annotations,Android,Android Annotations,我使用的是Android注释,我用@afterview注释的方法调用了3次。我调试了生成的类,我认为调用了这3个方法,但我不知道为什么 @Override public void setContentView(int layoutResID) { super.setContentView(layoutResID); afterSetContentView_(); } @Override public void setContentView(View view, LayoutPa

我使用的是Android注释,我用@afterview注释的方法调用了3次。我调试了生成的类,我认为调用了这3个方法,但我不知道为什么

@Override
public void setContentView(int layoutResID) {
    super.setContentView(layoutResID);
    afterSetContentView_();
}

@Override
public void setContentView(View view, LayoutParams params) {
    super.setContentView(view, params);
    afterSetContentView_();
}

@Override
public void setContentView(View view) {
    super.setContentView(view);
    afterSetContentView_();
}
-编辑1- 我的活动声明是我唯一设置布局的地方:

@EActivity(R.layout.real_estate_customer_leads_list)
public class RealEstateCustomerLeadsListActivity extends
    SlidingFragmentActivity implements FilterResponseHandler {

}

那可能是因为一个超级呼叫另一个。大概是这样的:

 // super.setContentView(layoutResID); code is:
 View v = LayoutInflater.from(getContext()).inflate(layoutResId);
 setContentView(v);

// then super.setContentView(view); code is:
setContentView(view, null);

// then super.setContentView(view, params);
this one now actually do real work. Hence, 3 calls!

他们没有被锁链锁住。我在一个活动中测试了一次是否正确调用@afterview方法。只调用了第一个public void setContentViewint layoutResID。这个答案是“最佳猜测”。很抱歉祝你好运