2016-11-21 5 views
0

私はこのエラーになっています「トークンに構文エラーが、代わりに期待AnnotationName」誰がそれを解決する.Can .--アンドロイド構文エラー、recyclerviewに代わり予想AnnotationName - アンドロイド

mRecyclerView.setLayoutManager(new LinearLayoutManager(products.this){ 
       mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { 
        @Override 
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) { 
         super.onScrolled(recyclerView, dx, dy); 

         totalItemCount = linearLayoutManager.getItemCount(); 
         lastVisibleItem = linearLayoutManager.findLastVisibleItemPosition(); 

         if (!isLoading && totalItemCount <= (lastVisibleItem + visibleThreshold)) { 

         if(totalItemCount!=array1.size()-1){ 
          if (mOnLoadMoreListener != null) { 
           mOnLoadMoreListener.onLoadMore(); 
          } 
          isLoading = true; 
         } 
         } 
        } 
       }); 
      } 
      }); 

私が取得メートルライン2すなわち 事前にmRecyclerView.addOnScrollListener(新RecyclerView.OnScrollListener(){

おかげで、今

答えて

0
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()){ 
     // what ever you want to do here is only for LinearLayoutManager methods 
    }); 

    mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { 
     @Override 
     public void onScrolled(RecyclerView recyclerView, int dx, int dy) { 
      super.onScrolled(recyclerView, dx, dy); 
      // implement your scrolled code here 
     } 
    }); 
+0

上のエラー、エラー-The方法getActivを取得新しい型のRunnable(){}に対してity()が未定義です –

関連する問題