android-listview

I want to measure the height of the ListView (getHight() = 0)

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 14:19:32
问题 I can not decide for himself the task will be to ask I want to measure the height of the ListView. Can not catch the moment of rendering ListView (rssListView.getHight(); = 0 ) public class RSSactivity extends Activity { public static RssItem selectedRssItem = null; String feedUrl = ""; ListView rssListView = null; ArrayList<RssItem> rssItems = new ArrayList<RssItem>(); ArrayAdapter<RssItem> aa = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

BaseAdapter: set hasStableIds() to false?

好久不见. 提交于 2019-12-10 13:57:05
问题 I have a ListView that uses a subclass of BaseAdapter . The adapter uses item indices (positions) as ids and thus the ids are not stable (one of the operations on the underlying data is swapping between two data items). Do I need to override in my adapter hasStableIds() to return false ? Looking at the BaseAdapter here suggest that false is the default . http://www.netmite.com/android/mydroid/frameworks/base/core/java/android/widget/BaseAdapter.java // Is this required? Isn't this the default

Custom ListView Item Graphical Layout Android

被刻印的时光 ゝ 提交于 2019-12-10 13:56:43
问题 Please forgive my ignorance, but this is my 3rd day with Android, and I've looked at tutorials, and they all seem to focus on the xml declaration of listview item UI. My question is this, I'd like to be able to see the custom listview item UI in the designer "Graphical Layout" in Eclipse. However, it displays it just like it does any other view in Android, ie. with the title and status bar at the top and taking up the entire screen. What I'd like to see is just the listview item that I'm

Preference List only shows first element

不问归期 提交于 2019-12-10 13:53:43
问题 I am developing a PreferenceActivity with custom Preference views. My problem is that I created a view with a ListView and it only shows the first element. I post my code and an image: http://imageshack.us/photo/my-images/545/sc20120307161530.png/ http://img545.imageshack.us/img545/7207/sc20120307161530.png' border='0'/> xml: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" > <PreferenceCategory android:key="player_settings"

Is it possible to scroll ListView to a listrow's child element?

孤街浪徒 提交于 2019-12-10 13:53:27
问题 I have a ListView with quite "high" rows. The rows have quite complex layouts, and I'd like to get ListView to scroll to exactly a child element of a row. Is this possible? I've only found .smoothScollToPosition(), but I can only specify a whole row in that. I need something more precise, to e.g. scroll to a child element in the middle of a row. Thanks. 回答1: Take a look at the ListView method smoothScrollToPositionFromTop (inherited from AbsListView) Smoothly scroll to the specified adapter

ListView (Adapter) item visibility listener

余生长醉 提交于 2019-12-10 13:53:26
问题 Is it possible to have a visibility listener on each listview's item? Like: on user sees the item, do something. On item is hidden, do something else. I want to check when a item "enters" or "exits" the scroll so as to update a second list. Additionaly my ListView might expand like: adapter.addAll( (Collection<? extends DBObject>) events); adapter.notifyDataSetChanged(); I think a way might be to use a global listener to check the items but I am afraid it will get messed up if I add more

Android menuitem onclick handler's return value

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 13:27:01
问题 In android when I define a menuitem's onclick handler in xml <item android:id="@+id/context_menu" android:orderInCategory="100" android:showAsAction="never" android:title="@string/word_context_menu_title" android:onClick="deleteItem"/> And in the corresponding activity I define a function deleteItem with the below signature. public boolean deleteItem(MenuItem item){ logger.info("delete button clicked"); return false; } My question is what does the return value signify? In which case should I

uiautomator - cannot get ListView to scroll as I validate text in each list item. it just fails when I hit the last item on screen

杀马特。学长 韩版系。学妹 提交于 2019-12-10 13:17:52
问题 I am trying to validate text in each list item in my ListView and scroll down one by one so I can validate each one... but for some reason I cant get it to continue scrolling through the list validating each element. Has anyone had any luck automating this kind of action.Here is the closest I can come to. Please let me know if this isn't enough info: UiScrollable scrollableList = new UiScrollable(new UiSelector() .resourceId("com.example.app:id/listView") .className(android.widget.ListView

Improving Scroll Smoothness in an Android ListView

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 12:54:21
问题 I have a an Android ListView that has small (say, 1-5 frame) stutters as it is scrolling, about every second or so. I realize that many Android phones have these problems with animation smoothness, however, on my phone (Motorola A855 running Android 2.2), the native contact list scrolls quite smoothly. The item view in the contact list is more complex than the item view in my list, which is: <RelativeLayout> <TextView /> <TextView /> </RelativeLayout> I only want to achieve smoothness as good

List item becomes unclickable if contains a RatingBar?

混江龙づ霸主 提交于 2019-12-10 12:51:55
问题 I have used custom listview and custom rating bar. If I add that custom RatingBar as child to the List item , the List Item becomes unclickable . If i remove that Ratingbar view then it becomes clickable . I used custom rating bar. here is the link. Can anyone help me to solve this problem? 回答1: If you want your rating bar to perform rating you can add android:focusable="false" android:focusableInTouchMode="false" to view of your row.xml If you want a static rating bar holding its rate you