android-listview

Android - delayed clicks in ListView

余生颓废 提交于 2019-12-02 22:39:33
I have the following structure in my app: FragmentActivity with ViewPager holding multiple fragments managed by FragmentStatePagerAdapter using compativility pack with Android 2.1 Each fragment contains ListView . Each element in the ListView has a LinearLayout with two TextViews and a Button . The LinearLayout and the button have onClickListeners (separate). Clicking on the LinearLayout starts another Activity . I noticed that the clicks behavior is very inconsistent: sometimes action is executed immediately but very often it is delayed and sometimes it's just ignored no matter how many times

assigning hidden values to a listview item

China☆狼群 提交于 2019-12-02 22:39:19
I have an activity that extends ListView. I populate my list with the results of a query to the sqlite database. A list element consists of start_time, end_time, client_name and status. These are the 4 bits on info I need to display for each list item. My question is: Is it possible for me to assign hidden elements to this ListView item? For example, I want to store the _id field of the database row for that ListView item, so that when I click it I can start a new activity based on data for that database row. EDIT The Code I use to fill my list from my Cursor: String[] columns = new String[]

ViewPager in a ListView - how to lock the scrolling axis?

邮差的信 提交于 2019-12-02 22:16:06
I have a ViewPager widget in every row of a ListView. This provides a shelf-like UI, so the user can scroll around searching for a shelf vertically, and then scroll horizontally amongst the contents of a shelf. This works. But the scrolling experience is terrible: if I start to drag a shelf's ViewPager, scroll it horizontally, and accidentally drag a bit upwards/downwards, then the ListView "traps" this dragging action, and start to scroll vertically, ending my horizontal drag. In this state, the drag action won't "return" to the ViewPager, the ListView has it, and that's it. I have to start

Android - ListViews inside tableLayout

五迷三道 提交于 2019-12-02 21:56:51
问题 I'm trying to build and app that shows organized data so I'm thinking that basically a TableLayout would be a good idea, just to keep them in rows, so I'm wondering whats the correct way to do it? I have this in my xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TableLayout android:id="@+id/tableLayout1" android:layout

How do i pass picasso into listView adapter

假装没事ソ 提交于 2019-12-02 21:28:27
问题 i need to pass this line into the list adapter Picasso.with(getActivity()).load(imageurl).into(imageOrders); List ListView list= (ListView) getActivity().findViewById(R.id.list); ListAdapter adapter=new SimpleAdapter(getActivity(),orderList,R.layout.order_usa_row, new String[]{TAG_PRICE,TAG_TITLE,TAG_PSTATUS,TAG_PRICESYMBOL,TAG_IMAGE},new int[]{R.id.price,R.id.title,R.id.pstatus,R.id.symbol,R.id.imageOrders}); list.setAdapter(adapter); i'm a begginer, i tried a lot but i can't figure it out ,

Volley Plus OutOfMemoryError in List Adapter

不羁的心 提交于 2019-12-02 21:24:26
问题 I am using Volley Plus library. I am showing ListView with image and text view with no error, but when i scroll up and down lots of time in this listview it get OutOfMemoryError and crash the application. Here is LogCat : java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again at java.lang.Thread.nativeCreate(Native Method) at java.lang.Thread.start(Thread.java:1063) at com.android.volley.RequestQueue.start(RequestQueue.java:135) at com.android.volley.cache.plus

Filtered list item opens the original list items' activity

╄→гoц情女王★ 提交于 2019-12-02 21:06:22
问题 After a tremendous amount of time searching in here, and everywhere else I am hopeless to find a solution. So here is my problem. I have created a list-view and on top of that I added a search-bar. When I use the search-bar, to filter the results... when I click on item 7, instead of opening the specific clicked activity i.e. 7, it always starts from the first one. I am looking forward to your help guys; because I need it! 回答1: public class Group extends ListActivity { // ArrayList thats

Custom ListView inside a dialog in android

佐手、 提交于 2019-12-02 21:01:12
问题 I am trying to make a custom dialog with listview which is going to contain checkboxes and textviews and i just couldnt find a reasonable tutorial to do it , any help or hints would be appreciated. 回答1: private void showPopUp() { final AlertDialog.Builder helpBuilder = new AlertDialog.Builder(this); helpBuilder.setTitle(""); LayoutInflater inflater = getLayoutInflater(); final View PopupLayout = inflater.inflate(R.layout.yourxml, null); helpBuilder.setView(PopupLayout); final AlertDialog

Gif not animated in custom listview

独自空忆成欢 提交于 2019-12-02 19:48:38
I want to display animated GIF images in my custom listview.my GIF image is get in web service url.GIF image displayed but not animated. public class NewsScreenAdapter extends BaseAdapter { LayoutInflater inflater; public GifDecoderView webview1; public static viewholder holder; View view = null; public static Context context; public ImageLoader IL; public String imgUrl; public static String addurl; public Activity activity; String image; public static Date parsed; public static String ac, cat_id; public NewsScreenAdapter(Activity a) { // TODO Auto-generated constructor stub context = a

How to highlight ListView item on touch?

瘦欲@ 提交于 2019-12-02 19:36:32
I have a simple ListView and I want each of it items to be highlighted on user's touch. I thought this should happen by default but it isn't. Can you advice? ListView xml: <ListView android:id="@+id/list_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" android:divider="#206600" android:dividerHeight="2dp" android:smoothScrollbar="true" android:background="#ffffff" > </ListView> And code of my Adapter: private class MyAdapter extends ArrayAdapter<Task> { private LayoutInflater mInflater; public MyAdapter(Context context, int resource, List<Task