I want to use a listView in my program. However, I also want to use some different components(Button, TextEdit etc.) in the same window. How can i do it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have to use Base Adapter for that. It is simple. There are four methods Inside this
1.getCount
2.getItem
3.getItemId
4.getView
class CustomListAdapter extends BaseAdapter
{
Then we have to create the object of the class and set That Object as:
CustomListAdapter customListAdapter = new CustomListAdapter();
listView.setAdapter(customListAdapter);
Above two lines you have to do inside the onStart or onCreate method.
I hope this will solve your problem…just check how the layout file has to create because their is two layout file has to create.