TextView countTV = mView.findViewById(R.id.main_left_count);
final TextView totalTV = mView.findViewById(R.id.main_left_total);
orderGoodsAdapter = new OrderGoodsAdapter(mContext,mView){
@Override
public void onRefreshBottom(int len,int total) {
super.onRefreshBottom(len,total);
countTV.setText(String.valueOf(len));
totalTV.setText(String.valueOf(total));
}
};
this code will show error "android java access from inner class, needs to declared final"
if you set the variable final, or set variable as a class field, the error will gone.
what's different for class field and final keyword?