UserListActivity.java
public class UserListActivity extends AppCompatActivity {
private RecyclerView mRecyclerView;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_list);
mRecyclerView = findViewById(R.id.rv_user_list);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
//test용
List<User> userList = new ArrayList<>();
for (int i = 0; i < 100; i++) {
userList.add(new User(i, "이름" + i, "userName" + i, "eamil@gmail.com" + i));
}
UserRecyclerAdapter rvAdapter = new UserRecyclerAdapter(userList);
mRecyclerView.setAdapter(rvAdapter);
}
}
반응형
'Platform > Android' 카테고리의 다른 글
[Error] lombok 적용이 안될 때-Annotation processors must be explicitly declared now. (0) | 2020.04.13 |
---|---|
[Jetpack] 0. 개요 (2) | 2020.04.03 |
[AAC] ViewModel | LiveData (0) | 2020.03.18 |
[Class] (0) | 2020.03.17 |
[aab] Android App Bundle (0) | 2020.03.06 |