android-listview

strange bug when i rotate the screen the listview inside of viewpager will disappear

不打扰是莪最后的温柔 提交于 2019-12-07 02:21:27
ok I have a very strange bug! when I rotate the screen for two times the listview inside viewPager will disappear but that only happen when I change the context of viewPager which is a listView (but as I said its work ok when I rotate for the first time and its ok when I don't change the viewpager by pressing on a radioGroup): I think the problem should be either when I change the adapter inside viewpager by radio group (I mean this code): myViewpager.setAdapter(new ViewPagerAdapter(fragManag, false)); myViewpager.setCurrentItem(200); or with listview inside the fragment (which viewAdapter)

Scrolling through ListView with some images very laggy

[亡魂溺海] 提交于 2019-12-07 02:02:14
问题 I've got the below screen that contains some images (6 per visible page). Scrolling up and down seems quite laggy to me. It's like it's rendering the images again. Scrolling back up seems worse than scrolling down. Anyone know how to increase performance in such an area to create a nice smooth scroll? Update : The images and text is all retrieved from my SQLite database. The list is created using SimpleCursorAdapter. private class HistoryViewBinder implements SimpleCursorAdapter.ViewBinder {

Why doesn't “notifyDatasetChanged()” notify all visible items?

一笑奈何 提交于 2019-12-07 01:58:58
问题 Background Note: I've been using listViews for ages, so I'm very familiar with how to work with adapters, ViewHolders, etc... so this issue doesn't make sense for me. This time I got into a very weird behavior that for some reason occur only on 2 devices: LG G2, with Android 4.2.2 Xperia J, with Android 4.1.2 The problem The listView has its own BaseAdapter, which on some events I update its items collection within it (on the UI thread) , and call notifyDatasetChanged(). The problem is that

ListView long click not working when a button is in list

不羁岁月 提交于 2019-12-07 00:26:42
问题 I have a ListView with custom list adapter. It has OnItemClickListener and OnItemLongClickListner which used to work fine. After then, I had to put a button in the layout of list item and the item click and long click listener stopped working. Here is my sample code: ListView lv=(ListView)findViewbyId(R.id.listview); lv.setAdapter(listviewadapter); lv.setOnItemLongClickListener(new OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view,int

After maintaining collapse/expand state for N-level or Multilevel expandablelistview some subgroups are not displayed

情到浓时终转凉″ 提交于 2019-12-06 21:21:24
问题 I worked a lot to create **N-level expandableListView. I am able to make it to any level but my requirement is to maintain the state of opened groups even after scroll. I tried with multiple ways but still unsuccessful. This Expandable listview is meeting with all company requirement other than this issue. *This is one way, which i tried. I am able to save the states within objects but few subgroups are not getting displayed. * I tried with onMeasure(width,height) method to maintain the

Get data from ListView when clicking ListView's child

独自空忆成欢 提交于 2019-12-06 20:51:28
I have a ListView with one button per row. If I needed to get the data when the row gets clicked, then it would be pretty easy to do the following inside the onItemClickListener: @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { CustomType type = (CustomType) arg0.getItemAtPosition(arg2); //get data related to position arg2 item } }); Actually, the thing is that I need to get the data(i.e: CustomType object) when the button of the ListView's row get's clicked, and not the row itself. Since OnClickListener doesn't have something like AdapterView as a

getView showing random items when scrolling

拈花ヽ惹草 提交于 2019-12-06 20:16:29
I have my class PlannerListAdapter that extends BaseAdapter and i have 2 problems in my getView() method. 1) When i set my adapter to the listview, everything it's ok, the listview show me all the elements i have in my List, I scroll down and i can see all the elements of the list. But when i scroll up, the elements starts to switch each other and also are being repeated, also, it is changing me the order of the elements, why is this happening? 2) In my BrandPlannersList i have a String[] socialNetworks object. I want to change the social networks (twitter, facebook, instagram) default image

Android Listview in PopupWindow onitemclick not work on some device

旧城冷巷雨未停 提交于 2019-12-06 19:14:11
问题 My ListView is inside PopupWindow. When i shown PopupWindow and click on Listview row in device ASUS K00z fonepad worke very well. But in HTC Z715e is not working (onitem click event not fired) 1.This is my listview item layout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ln_testpopitemcon" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="52dp" android:background="#3b8ed4" android:descendantFocusability=

How to apply android layout animation only to children above a certain index?

旧时模样 提交于 2019-12-06 17:59:59
问题 I have a ListView containing a series of notes. Currently I use a layout animation to slide all the notes in from the side when the list first loads; this works perfectly. However, I'm trying to figure out how to apply a layout animation only to list items below a certain point. Say I delete an item on the list: I'd like all items below it to shift up into the deleted note's old spot. I've tried finding a way to customize the animation delays or interpolators by child index but haven't found

How to set Filter to ListView with CursorAdapter?

断了今生、忘了曾经 提交于 2019-12-06 16:34:17
I have a ListView . which of it's items are from custom CursorAdapter . I have created separate layout for ListView items which is a CardView . I have six TextViews on each card they are Database values. Now i have to put a EditText to filter the ListView items according to the text entered in EditText. My Code is layout with ListView is <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#1d4563"> <ListView android:layout_width="wrap_content"