android-listview

Why is my onItemSelectedListener not called in a ListView?

别说谁变了你拦得住时间么 提交于 2019-12-18 01:19:12
问题 I'm using a ListView that is setup like this: <ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:longClickable="false" android:choiceMode="singleChoice"> </ListView> In my code I add an OnItemSelectedListener to the ListView like this: getListView().setAdapter(adapter); getListView().setOnItemSelectedListener(this); my Activity implements the listener like that: @Override public void onItemSelected(AdapterView<?> parent, View

Android - Adding and showing items to ListView one at a time using an ArrayAdapter

只谈情不闲聊 提交于 2019-12-17 22:42:36
问题 I'm using an ArrayAdapter to add items to a custom ListView and showing the results in my Android app. The problem I'm having is that the ArrayAdapter seems to wait until all items are in it before it shows the view. That is to say, when I'm adding the items to the ArrayAdapter and I call notifyDataSetChanged, it does not update the ListView to show the added item. It waits until all items are added and GetView is called before showing the items. What I would like it to do is to show the item

ListViewDraggingAnimation broken on Android 5 Lollipop

烂漫一生 提交于 2019-12-17 22:39:09
问题 I'm using ListViewDraggingAnimation by DevBytes, but it seems broken on Android Lollipop developer preview 2 (LPX13D). When I drag a row over other rows, those rows will disappear and become no longer clickable (see below). I tried disabling hardware acceleration for the listview but it didn't have any effect. Has anyone experienced the same issue? Any hints? Thanks :) 回答1: I found the problem. It came from this flag. StableArrayAdapter.hasStableId . It fix all problem from this view on

Synchronize all the ListView in a ViewPager

寵の児 提交于 2019-12-17 22:25:51
问题 In my application I have a ViewPager with each one a custom ListView in it linked toghether like row in a table. The problem is that when I scroll a ListView in the first page and then I scroll the ViewPager the ListView of the first page and the ListView of the second page are misaligned. The listView must be aligned because in the first one i have a TextView with a description and then 4 coloumns with datas and in the next ListViews 6 coloumns without the description so if they are

Bind button click inside customlayout using mvvmcross and mvxlistview

南笙酒味 提交于 2019-12-17 21:32:12
问题 i wanted to bind a button click event inside my customlayout, below is my customlayout <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="63dp"> <LinearLayout android:orientation="horizontal" android:minWidth="25px" android:minHeight="25px" android:layout_width="match_parent" android:layout_height="match_parent" >

How to create Google + cards UI in a list view?

旧城冷巷雨未停 提交于 2019-12-17 21:27:01
问题 I want to create a listView of cards, but after reading this blog post goolge-plus-layout, I'm cards are a viable solution for a list of anything. The animation part seems too memory intensive to load say a listview with more than 40 elements simultaneously. Is there a better way to achieve a cards UI in listView? 回答1: You can create a custom drawable, and apply that to each of your listview elements. I use this one for cards in my UI. I don't think there is significant performance issues

Swipe ListView item From right to left show delete button

本小妞迷上赌 提交于 2019-12-17 21:26:11
问题 I have a custom ListView showing the list of words selecting from database. When I swipe this listview item i want to show Delete button like image below. And when I press that button it is deleted from Database and refresh the listview. m I already look in this sample code here. But it still does not work. 回答1: EDIT: between other options there's a nice library that could solve your issue: https://github.com/daimajia/AndroidSwipeLayout 回答2: i've searched google a lot and find the best suited

Android: list.getCheckedItemPositions() always returns null

我的梦境 提交于 2019-12-17 21:23:03
问题 I've created a custom ListView by extending SimpleCursorAdapter. The result is IMAGE + CheckedTextView (Text + Checkbox). After I had issues with the wrong checkboxes getting checked (see here) I had to remove lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); from onCreate. Now I click on a ListItem line and it checks the right checkbox. What I'm trying to do is make a LinearLayout.VISIBLE when 1 or more checkboxes are checked AND make LinearLayout.GONE when no checkbox is checked. Here is the

Setting more than one adapter for a single list view

∥☆過路亽.° 提交于 2019-12-17 20:49:45
问题 Is it possible for setting more than one adapter to a single list? For example list.setAdapter(adapter1); list.setAdapter(adapter2); 回答1: Maybe you can try attaching multiple adapters to a single adapter like here android attaching multiple adapters to one adapter Or maybe this http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/ if I understand what you need it for correctly Pls update why you want it for so we have a better understanding 来源: https://stackoverflow

Android: listview: custom items: nullpointerexception, findviewbyid returns null

不羁岁月 提交于 2019-12-17 20:33:49
问题 I have been googling and searching to resolve this error for some time and I can`t seem to find out why and how to solve it. I`m using a customAdapter to fill in my listview. I inflate the xml describing my listItem. I make viewHolder object and load in my textview using findViewById. After that i want to set the text of that textview but it findViewbyid returns a null value. So automaticcally resolving into a nullpointerexception. Adapter: /** CLASS : Custom Adapter for the listview */