android-listview

Add a Button to a ListView for each Element

£可爱£侵袭症+ 提交于 2020-01-25 11:03:11
问题 I am creating a shopping cart app and I am trying to populate a String[] Product which is called items. Each item has an ID a Name and a Price. The issue I am having is that I am trying to make a custom ListView but I can not get it to run on my android device. It keeps crashing every time I use a customer ListView. Maybe I am not doing it right or I need to create a customer adapter as well? I have tried these methods but neither were successful. Here is what I have, I currently am using the

Android ListView, with EditText ListItem move to Next

╄→гoц情女王★ 提交于 2020-01-25 10:04:28
问题 I have a ListView that has ListItem with EditText. This is to simulate a long Form. Once the user is done entering field, I want the cursor to move to next row, i.e. Next ListItem. To get the next button, in the ListItem xml, I set the ime option to next: <EditText android:id="@+id/input_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:imeOptions="actionNext"/> The form could be long with over 20 items to enter. At a given time only 7 rows are visible.

ListView not getting space to show content on smaller screens

蹲街弑〆低调 提交于 2020-01-25 06:45:28
问题 So I am developing a screen where there are some images and buttons on top and Below that is a list view which shows a list of some activity. The design is something like this :- Now on smaller screen the ListView height becomes very small as the screen space is taken up by the above icons and images. So how can i increase the height of the Linearlayout or ListView so that user can scroll to the see the rest of the ListView. <LinearLayout android:layout_width="match_parent" android:layout

Searchbar Changing Positions due to filtering

ぐ巨炮叔叔 提交于 2020-01-25 03:27:08
问题 I have been working on a project, in which i have a main activity in which i have listview and one search bar(edit text bar) and the onitemclicklistener of my listview passes the row position to a activity having webview and the webview opens html pages to their respective positions. i also have my listview items stored in arrays.xml my problem starts here- my Listview Works file and opens respective activity on row click (when i dont use search bar and just scroll and click on row.) but when

Why ListView onScroll() gets called mutiple times and everytime WITH SAME ARGUMENT AMOUNTS?

流过昼夜 提交于 2020-01-25 01:22:30
问题 I debugged several times. It's driving me crazy. My listView.onScroll() function gets called several times and every time with arguments all 0! Which causes the listView to show THE SAME list over and over when scrolled. I even manually set the arguments but still no change. Why on earth would onScroll get called multiple times? It's not like it gets caught in a loop because some times the result appears on the screen! I call a RESTfull webService wich has pagination. Here is a piece of my

Erratic behaviour of listview (Android)

梦想与她 提交于 2020-01-24 22:58:49
问题 In my listview I have a custom Adapter, which I build using a TreeMap, I defined the getView method which is as follows. I am trying to strike out the text in a certian textview of the listview on click, only those textviews will be striken off which contain a certain pattern of characters (y@y). However on clicking one row in the listview I am getting strike out effect on some other row. public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater =

send a row from a listview saved in database sqlite to another listview and make it do the same as the row in the first listview

家住魔仙堡 提交于 2020-01-24 19:30:42
问题 i have two activities each one of them have a listview the first one is connected to a data base and get its data from strings.xml i want to send a row to the other listview in the aother activity and make it do the same as if it was in the first list view i did that before but all the data was saved in the database directly (no strnigs.xml) here is my code please help me public class DB_Sqlite extends SQLiteOpenHelper { public static final String BDname = "data.db"; public static final int

Filtering a ListView using an ArrayAdapter without overriding getFilter method

 ̄綄美尐妖づ 提交于 2020-01-24 10:23:27
问题 In this Stackoverflow answer, it is indicated that filtering can be accomplished in a ListView without overriding the getFilter method of the ArrayAdapter and instead implementing toString in the POJO class. I have tried implementing it, but the filtering is not working correctly. Although the ListView does filter, it doesn't show the correct items in the array. So, for example, if the filter matches a single row in the array then one item is shown in the ListView , but it is the wrong item

Filtering a ListView using an ArrayAdapter without overriding getFilter method

别说谁变了你拦得住时间么 提交于 2020-01-24 10:23:09
问题 In this Stackoverflow answer, it is indicated that filtering can be accomplished in a ListView without overriding the getFilter method of the ArrayAdapter and instead implementing toString in the POJO class. I have tried implementing it, but the filtering is not working correctly. Although the ListView does filter, it doesn't show the correct items in the array. So, for example, if the filter matches a single row in the array then one item is shown in the ListView , but it is the wrong item

Getting NullPointerException in custom ListView

浪尽此生 提交于 2020-01-24 07:32:31
问题 I'm getting errors like this when I run my app: 02-27 22:59:19.331: E/AndroidRuntime(2060): FATAL EXCEPTION: main 02-27 22:59:19.331: E/AndroidRuntime(2060): java.lang.NullPointerException 02-27 22:59:19.331: E/AndroidRuntime(2060): at myPlanAdapter.getView(MyPlanActivity.java:145) 02-27 22:59:19.331: E/AndroidRuntime(2060): at android.widget.AbsListView.obtainView(AbsListView.java:1315) 02-27 22:59:19.331: E/AndroidRuntime(2060): at android.widget.ListView.measureHeightOfChildren(ListView