我已經實現了這個方法,就像許多其他教程所說的,但在我的情況下,編譯器會引發錯誤。爲什麼?SCROLL_STATE_IDLE無法解析符號爲什麼?
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
final RecyclerView recList = (RecyclerView) v.findViewById(R.id.ratingIconList);
recList.addOnScrollListener(new RecyclerView.OnScrollListener(){
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (newState == SCROLL_STATE_IDLE) {
MainActivity.programmaticScrollEnable = true;
}
}