android-arrayadapter

ArrayAdapter and ListView display only specific items

寵の児 提交于 2020-01-06 19:42:22
问题 I am trying to impement a school planner app. There is a timetable overview implemented as a ListView for each day wrapped into a Tab Layout. So the user can switch between days Monday to Friday and gets his timetable for the specific day. public class TimetableAdapter extends ArrayAdapter<Lesson> { private List<Lesson> lessonList; // The model ... public View getView(int position, View convertView, ViewGroup parent) { View view = null; ... view = inflater.inflate(R.layout.timetable_row, null

ArrayAdapter and ListView display only specific items

左心房为你撑大大i 提交于 2020-01-06 19:42:11
问题 I am trying to impement a school planner app. There is a timetable overview implemented as a ListView for each day wrapped into a Tab Layout. So the user can switch between days Monday to Friday and gets his timetable for the specific day. public class TimetableAdapter extends ArrayAdapter<Lesson> { private List<Lesson> lessonList; // The model ... public View getView(int position, View convertView, ViewGroup parent) { View view = null; ... view = inflater.inflate(R.layout.timetable_row, null

How to properly add data to ArrayList - Android

谁都会走 提交于 2020-01-06 14:47:22
问题 I have a class the extends arrayAdapter. I am trying to add variables to the list but I am not sure exactly how to do so. Here is my current ArrayAdapter class. class Item { String username; String number; String content; } class ListAdapter extends ArrayAdapter<Item> { public ListAdapter(Context context, int textViewResourceId) { super(context, textViewResourceId); // TODO Auto-generated constructor stub } private List<Item> items; public ListAdapter(Context context, int resource, List<Item>

How to properly add data to ArrayList - Android

≯℡__Kan透↙ 提交于 2020-01-06 14:46:08
问题 I have a class the extends arrayAdapter. I am trying to add variables to the list but I am not sure exactly how to do so. Here is my current ArrayAdapter class. class Item { String username; String number; String content; } class ListAdapter extends ArrayAdapter<Item> { public ListAdapter(Context context, int textViewResourceId) { super(context, textViewResourceId); // TODO Auto-generated constructor stub } private List<Item> items; public ListAdapter(Context context, int resource, List<Item>

How to populate ListView from ArrayAdapter

走远了吗. 提交于 2020-01-06 07:04:25
问题 I'm reading an HTML page and get values from a table consisting of two colums . These values I need to insert into a ListView . I'm having a hard time grasping the concepts of Arrays , and ArrayAdapter , so I've tried to put something by reading various code examples. My code works perfect when I fill my ArrayAdapter statically (in Java code), but I need to use a loop (or something?) to fill the contents of the array with what I get from the HTML page (all that code works and is in place).

How to populate ListView from ArrayAdapter

浪尽此生 提交于 2020-01-06 07:04:04
问题 I'm reading an HTML page and get values from a table consisting of two colums . These values I need to insert into a ListView . I'm having a hard time grasping the concepts of Arrays , and ArrayAdapter , so I've tried to put something by reading various code examples. My code works perfect when I fill my ArrayAdapter statically (in Java code), but I need to use a loop (or something?) to fill the contents of the array with what I get from the HTML page (all that code works and is in place).

Send click event from RecyclerView to parent ListFragment or ListAdapter

倾然丶 夕夏残阳落幕 提交于 2020-01-06 05:43:18
问题 I have a ListFragment with some ListItems. In one ListItem I have some Views and also a RecyclerView with CardViews. In the CardView is a ImageView. I want to use the RecyclerView to have some pictures in it and I want to scroll the pictures. I also want to zoom the pictures with a two finger-gesture. (Would be nice if someone knows a good step by step tutorial therefor). But I also want to click and longclick on the pictures. I need the click and longclick in my ListArrayAdapter or in my

Android ArrayAdapter & ListView slowness

梦想与她 提交于 2020-01-06 04:09:09
问题 To display & load images in my ListView I've created a custom ArrayAdapter, however it is really slow. Every time I scroll through the list it loads the images again. Is there a caching mechanism which will cache my Views so I don't need to refill them every time? I know about the ViewHolder method, however this still is slow or am I just using it wrong? My code: public class ImageArrayAdapter extends ArrayAdapter<HashMap<String, String>> { private int resourceId = 0; private LayoutInflater

Android ArrayAdapter & ListView slowness

坚强是说给别人听的谎言 提交于 2020-01-06 04:09:09
问题 To display & load images in my ListView I've created a custom ArrayAdapter, however it is really slow. Every time I scroll through the list it loads the images again. Is there a caching mechanism which will cache my Views so I don't need to refill them every time? I know about the ViewHolder method, however this still is slow or am I just using it wrong? My code: public class ImageArrayAdapter extends ArrayAdapter<HashMap<String, String>> { private int resourceId = 0; private LayoutInflater

adding more items to custom ArrayAdapter

穿精又带淫゛_ 提交于 2020-01-06 04:05:52
问题 I have a listview which i populate using cusome ArrayAdapter , each row in the listview contain image and title . i followed this tutorial http://www.vogella.com/tutorials/AndroidListView/article.html to create custom arrayadapter and populate my listview using it like the following : here i attach the adapter to my list in MainActivity: newsAdapter = new NewsAdapter( getActivity() , titles , images ); listView.setAdapter(newsAdapter); each of images and titles are ArrayList objects which i