Android: 使用 @ViewInject 来替代 findViewById
访问量: 3495
如果你在android 项目中看到这样的代码:
// 变量声明中 @ViewInject(R.id.textView_dialog) private TextView textView_dialog; // onCreate方法中: ViewUtils.inject(this);
不用慌, 它就等同于:
private TextView textView_dialog; //... textView_dialog = (TextView)findViewById(R.id.textView_dialog);