android-listview

How to get text from EditText within ListView with multiple Views?

最后都变了- 提交于 2020-04-10 04:05:43
问题 I have a ListView that contains two TextViews and one EditText in each row. I have searched and searched and cannot figure out how to get the text that the user enters into the EditText. My most recent attempt implements a TextWatcher. public void addIngredientToMeal(String ingredientName) { ingredient_list = (ListView) findViewById(R.id.ingredients_in_meal_listView); int numberOfIngredients = ingredient_list.getChildCount(); ListAdapter adapter = new ListAdapter(); adapter.name_array = new

Android Done button instead of Next

北战南征 提交于 2020-03-18 11:17:59
问题 I have a problem with the keyboard. I have a ListView with edit texts, and when the keyboard opens for the first time the Done button is displayed instead of Next. The problem is that I need to use adjustResize in the AndroidManifest.xml and the list is moved up when the keyboard is displayed, so I think this is why the keyboard is not working properly. How can I solve this issue? 回答1: Add android:imeOptions="actionDone" to the field where you need a done button on your keyboard. Add android

Android Done button instead of Next

跟風遠走 提交于 2020-03-18 11:16:59
问题 I have a problem with the keyboard. I have a ListView with edit texts, and when the keyboard opens for the first time the Done button is displayed instead of Next. The problem is that I need to use adjustResize in the AndroidManifest.xml and the list is moved up when the keyboard is displayed, so I think this is why the keyboard is not working properly. How can I solve this issue? 回答1: Add android:imeOptions="actionDone" to the field where you need a done button on your keyboard. Add android

How to Refresh ListView in Fragment that is filled with BaseAdapter?

倾然丶 夕夏残阳落幕 提交于 2020-03-14 09:22:34
问题 I want to Refresh a ListView in a Fragment when a Dialog is closed. Until now the refresh only works when I restart the app and I don't really know why. Here are the classes: This is the Fragment with the ListView on it, that i want to refresh, when the Dialog is closed. public class RegisterListFragment extends Fragment { public static final String TAG = "RegisterListFragment"; RegisterListAdapter adapter; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,

How to Refresh ListView in Fragment that is filled with BaseAdapter?

折月煮酒 提交于 2020-03-14 09:16:51
问题 I want to Refresh a ListView in a Fragment when a Dialog is closed. Until now the refresh only works when I restart the app and I don't really know why. Here are the classes: This is the Fragment with the ListView on it, that i want to refresh, when the Dialog is closed. public class RegisterListFragment extends Fragment { public static final String TAG = "RegisterListFragment"; RegisterListAdapter adapter; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,

android Recyclerview Layoutmanager's onLayoutChildren called when item content is changed

别来无恙 提交于 2020-03-01 04:33:10
问题 i have a recycler view with custom layout manager ( its a twowayview staggeredgridview layout manager https://github.com/lucasr/twoway-view/blob/master/layouts/src/main/java/org/lucasr/twowayview/widget/StaggeredGridLayoutManager.java ) i am using this to display list of Images. These images are loaded asynchronously, meaning ,when the items becomes active, i decode image data and then load that bitmap onto these list item views. now, problem is whenever i set image bitmap onto an item's

Flutter - Listview.builder inside another Listview

元气小坏坏 提交于 2020-02-27 04:55:06
问题 I want my screen to be scrollable so I put everything in a Listview. Now I want to show another Listview inside to show details of a List. When I try this an error is thrown - " Expanded widgets must be placed inside Flex widgets." 回答1: Add shrinkwrap: true in listview.builder & Remove the top most container or replace it with column . 回答2: Adding shrinkWrap: true, physics: ScrollPhysics(), inside the listview.builder, in this case the listview.builder need an expanded parent. The physics:

CardView and RecyclerView divider behaviour

北城以北 提交于 2020-02-24 17:02:50
问题 I am trying to use RecyclerView with CardView as an single item of the list. I want to implement horizontal list, with LayoutManager it is really easy. So I started to implement it. It seems that everything works, but not as I expected here is the result using CardView as an list item. Looks pretty good, but I haven't set any paddings, dividers and rounded corners. Here is my XML for card view item. <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView xmlns:android="http

Listview with a MPAndroidChart(or whatever) below

心已入冬 提交于 2020-02-24 11:31:33
问题 Edit: I changed the title because isn't about MPAndroidChart, the same issue would happen with another view below the ListView. I am trying to set a layout for an activity in my android app. This activity consist on 2 elements, a ListView and a MPAndroidChart. What I would like to achieve is to place the ListView at top, taking the height that it needs ( wrap_content ) and below it the chart with a fixed height. I'm newbie on android, so the first thing I made was make a RelativeLayout with

How to change listview item background color using if condition Android

我的未来我决定 提交于 2020-02-16 11:31:07
问题 I'm creating an app with listview and I added few values like 101,102 to 110 to the listview. Now I have to change the listview item background colour using edittext. For example if I type 101 and click submit button, background colour of 101 should change. Please help. Please...... 回答1: First Declare the layout of adapter linearlayout = itemView.findViewById(R.id.linearLayout); then set color if match the number in onBindViewHolder() if((position.Value())==typedValue){ holder.linearlayout