package com.tdc.shop.activity;
import java.util.ArrayList;
import java.util.List;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.tdc.adapter.SearcheHotAdapter;
import com.tdc.shop.R;
public class SearcheActivity extends BaseActivity {
private RecyclerView id_recyclerview;
private List<String> mDatas ;
//private SearcheNineAdapter searcheNine;
@Override
int getLayoutId() {
return R.layout.searcheactivity;
}
@Override
void findView() {
id_recyclerview =(RecyclerView) findViewById(R.id._recyclerview);
}
@Override
void initView() {
mDatas =new ArrayList<String>();
String[] mData={"五粮液","茅台","泸州老窖","汾酒","西风","洋河","剑南春","水井坊","拉菲","酒鬼酒","名状","人头马","轩尼诗","奔富"};
for (int i = 0; i < mData.length; i++) {
mDatas.add(mData[i]);
}
}
@Override
void initData() {
id_recyclerview.setLayoutManager(new GridLayoutManager(SearcheActivity.this,5));
id_recyclerview.setAdapter(new SearcheHotAdapter(SearcheActivity.this,mDatas));
}
}
错误截图: