android-listview

How to disable ListView item after it has been clicked?

北慕城南 提交于 2019-12-12 13:29:03
问题 I have a simple array of Strings that I was displaying in a horizontal ListView with an ArrayAdapter . What I'm looking to do is: when the user selects an item from the ListView , make that item not clickable and change the background color of that item. Perhaps like a "grayed-out" look to it. I was looking into creating a custom Adapter and overriding the isEnabled(int position) method but I don't know how I would go about this. Any advice, suggestions, or help will be greatly appreciated

How to add horizontal scroll view and a listview in Android

喜欢而已 提交于 2019-12-12 13:17:03
问题 I am trying to create a application in that i need to create a list view but on the top of that i want a horizontal listview for multiple data .I am confused how can we do this .please help me in this MainActivityXML <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen

How to pause/destroy the webview in android fragments?

隐身守侯 提交于 2019-12-12 12:45:46
问题 I have fragment in that contains the list view.In listview loaded with webview's for playing the video's. playing the video's are success but if video is playing i am moved to another fragment video playing is not stopped.video play's the back ground. How can i stop/pause/destroy the webview video in android when moving from one fragment to another fragment? 来源: https://stackoverflow.com/questions/34606855/how-to-pause-destroy-the-webview-in-android-fragments

ListView scroll - one by one

纵饮孤独 提交于 2019-12-12 12:33:29
问题 I have a ListView that must display 4 items at a time. And I must scroll one item, one by one. After user scrolls the ListView, I must readjust the scroll to fit 4 items. I mean, I can´t show an item by half. Another question, is there any way to get the current ListView scrollY offset? Because the listView.getScrollY() method is from View, but not the Scroller object inside the ListView. 回答1: I've found an excellent solution. It works perfect for me. May be my answer will help someone. class

EditText weird behaviour in ListView BaseAdapter

倾然丶 夕夏残阳落幕 提交于 2019-12-12 12:13:07
问题 I got a ListView, populated using BaseAdapter . In the listview Item there's a numeric EditText: ... <EditText android:id="@+id/edit_quantita" android:layout_width="50dp" android:layout_height="30dp" android:layout_gravity="center" android:layout_marginTop="5dp" android:background="@drawable/edit_quantita" android:gravity="center_vertical|center_horizontal" android:inputType="number" android:text="1" android:textColor="#fff" tools:ignore="HardcodedText" > </EditText> ... When I tap on this

Android list view inside a scroll view auto scroll issue

大兔子大兔子 提交于 2019-12-12 10:44:17
问题 I have an android layout setup where I have a ScrollView with some elements and inside that I have a ListView. I am using StackOverflow's answer Android list view inside a scroll view for achieving this feature and it's working fine. My ListView is below some elements like TextView, ImageView. Problem is that when the page is presented ListView get scrolled automatically so that first item in listView is at the top (ie whole scrollview gets scrolled to present listview first item). How can I

How to control viewPages pages from another page

旧街凉风 提交于 2019-12-12 10:37:31
问题 I have a ViewPager with 3 pages with listView in each page. I want to animate listView in a way that when user swipes horizontally for next page the items of listView should come according to the width of next page. i.e The first item should be pushed in completely ,second should be visible half ,thirst should be visible half of the second and so on. This type of animation is already in mi3 xiamo for contacts list. In above image I am swiping in the right direction.Note the 'Recent' list

NullPointerException at android widget ArrayAdapter createViewFromResource

只愿长相守 提交于 2019-12-12 10:29:13
问题 I am a new to android ArrayAdapters and I am facing a null pointer exception when populating my ListView. The data which I used to populate the listview is not null, I had checked that. Also the whole thing is working fine on first load, but once I scroll down to the end of the list, the App crashes. Here is my stack trace: E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.NullPointerException at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:394) at android.widget

How to make font sizes in app to not get effected by changing Settings Font size

守給你的承諾、 提交于 2019-12-12 10:28:36
问题 I have my app running well as per design when the font size is at "Normal" on Settings->Display->FontSize. When i change the font size to Small/Large entire content is mashed up. My app is content intensive and this is badly effecting the app. Lets say, action bar title is like "Privacy and Settings". The title runs off the bounds/ellipsizes when font size is set to "Large" in System Settings. The listview contents look pathetic. Is there a way to make sure that the change in Settings->Fonts

How change color of specific item of listview?

半世苍凉 提交于 2019-12-12 09:41:33
问题 I have a customlistadapter as follow: public class CustomListViewAdapter2 extends ArrayAdapter<RowItem> { List<Integer> baseOnThis; public CustomListViewAdapter2(Context context, int resourceId, List<RowItem> items, ArrayList<Integer> ids) { super(context, resourceId, items); this.context = context; baseOnThis= ids; } /* private view holder class */ private class ViewHolder { TextView firstHemistich; TextView SecondHemistich; } public View getView(int position, View convertView, ViewGroup