Write a program that shows the creation of reusable user interface that includes the layout.
Answer / Sakshi Bhardwaj
"Here's an example using RecyclerView and CardView:
1. Define custom ViewHolder for your list items in a separate class, extending RecyclerView.ViewHolder.
2. Implement a ListAdapter for your data source and extend RecyclerView.Adapter.
3. In the onCreateViewHolder method, inflate the layout you want to reuse, and return the ViewHolder instance.
4. Override onBindViewHolder method to populate the UI elements in each list item with data from the data source.
5. Create a RecyclerView in your activity's layout and set the adapter for it using setAdapter(MyListAdapter).
6. Set the layout manager by calling RecyclerView.setLayoutManager(new LinearLayoutManager(context))."n
| Is This Answer Correct ? | 0 Yes | 0 No |
What is Adapter?
How many dialog boxes do support in android?
Which file is entry point for sencha touch app?
What does adb stand for?
What is so special about android?
What items are important in every android project?
How do I update google play services on android?
What is a layout resource?
Define and explain android framework.
what is the difference between this and getapplicationcontext in android?
Choose right kind of layouts supported in sencha touch?
What is colorstatelist?