Questions tagged [android-listview]

1

votes
1

answer
2.7k

Views

Change dynamically items in a listView

I'm using a custom ListView with a Title and a Subtitle where you can read a brief explanation of the item. For each item on the list, I'm displaying an AlertDialog to select an option (different for each case). When the option is selected, i want to change the Subtitle for the option selected by th...
Kitinz
-1

votes
1

answer
17

Views

How can I delete a listview item permanently?

I have this code, where the listview item gets deleted from the list, but after I reload the listview, the item re-appears again. How do I delete the item permanently? Please help me. The code for deleting the listview item : b2.setOnClickListener(new View.OnClickListener() { @Override public void o...
Lubji
1

votes
2

answer
47

Views

Android Listview and Horizontalview - don't know how to get the image filename if the image is clicked

I hope any Android developer can help me how to get the image filename when the image is clicked on the HorizontalView List. I try to add the setOnClickListener tp the imageview field, but it doesnt work and it crashed not able to slide from the Horizontal view list. What i tried was I add the fol...
1

votes
1

answer
43

Views

Will be selected wrong item position in the ListView?

I'm trying to implement a search function to search in the SQLite database by a keyword by following this example. Here are my codes: AndroidManifest.xml MainActivity.kt class MainActivity : AppCompatActivity() { lateinit var cars: ListView lateinit var car_adapter: CarAdapter override fun onCreate(...
Mark Delphi
1

votes
2

answer
49

Views

android listview show items on top of other elements

I have series of elements in android layout as shown in attached image. one of the element is searchview and below searchview, there are other elements. i have written a code to display list items. when i click on searchView, the list items are shown. but i want the list items to be shown on top of...
user1439582
1

votes
2

answer
52

Views

How can I fix my listView duplicating the same element when I add another element?

I'm trying to create a budget application on Android Studio (complete beginner), and I'm currently having an issue: I basically have a listView where I can add any of my purchases (name and value + the day I buy it) Whenever I add an element to my listview, instead of adding another element, the new...
cdaveau
1

votes
1

answer
61

Views

How to set nested recycler views adapters when we use data binding?

I have a nested recycler view(a parent and several childs), I also use data binding. The problem is that, since the adapter for nested recyclers is different, I do not know how to set the nested recyclers adaptor in Kotlin or Java. In case I don't want to use data binding, the solution in this link...
Ali Zahedi
1

votes
4

answer
56

Views

Using two images in ListView Android

I'm trying to put two images in a listView using a ArrayList, but when I run the project, just one image appear (the truck one), but the star one didn't appear. The Android Studio didn't show me any error. Someone can look at my code and point me, what am I doing wrong? ListaDistribuidoresActivity....
Laura Regina
1

votes
1

answer
34

Views

ListView specific item color

I list site addresses with Android listview.I tried for hours, but I couldn't find a solution. for example http://site .com http://site2 .com http://site3 .com http://site4 .com if have http://site3.com in listView i want to change the color of this line. final ListAdapter adapter = new SimpleAdap...
Hafsel
1

votes
1

answer
27

Views

Trying to pass an item and subitem with a button

I am trying to pass values from an EditText (item and Subitem) with a Button to a listview I am able to view the TextView, but is there a way to pass the EditText to the TextView with onClick and send that TextView to the listview Here is my XML file
B-rad
1

votes
0

answer
23

Views

How to make a listview in Widget horizontal?

I am making a widget for my application. It currently has a regular ListView which scrolls vertically. What I want is that it should scroll Horizontally. As Widgets don't support any customViews, I can't use any libraries. Also, as widgets don't support RecyclerViews I can't use them either. How do...
Anita
1

votes
2

answer
59

Views

Binding in ListView in XAML Xamarin

Could someone answer me the question about listview? I have variable MyDatas which is collection of listview (and it works): ... Next I have (part of my code but is enough for explaining the problem): E1 is a field of MyDatas and this binding works correct. I have property of fonts in another variab...
Mirek
1

votes
2

answer
41

Views

Why Custom ArrayAdapter not showing TextView in a ListView

I have made a custom ArrayAdapter and tried to add the another TextView 'Breed' of the animals, but when i execute the program , its not showing the Breed. Where am i doing wrong ? I am scratching my head since long. please help where is the mistake ? MainActivity.Java public class MainActivity exte...
Digital Democracy
1

votes
0

answer
39

Views

Android ListView with ArrayAdapter replacing list item components

Please check the last update down below as I found the issue but don't know how to fix it [Update: project download link] which is very tiny it's just a sample and added Questions class I'm creating a ListView with ArrayAdapter for a quiz. every question has 3 answers as radio buttons. The problem i...
PHP User
1

votes
3

answer
50

Views

Error creating custom listview in fragment. Required activity, found fragment

I decided to create custom listview in my fragment, but I get an error: FragmentOne.kt: (41, 53): Type mismatch: inferred type is FragmentOne but Activity was expected. Code below. FragmentOne.kt class FragmentOne : Fragment() { val name = arrayOf( 'First catch','Second catch','Third catch','Fourt...
Sn0w
1

votes
2

answer
150

Views

ListView layout height not matching the parent inside RecyclerView in Fragment

I have RecyclerView with Horizontal scroll inside a fragment. There are TextView and ListView Inside the RecyclerView. The ListView height is not matching the parent Height as expected. This is how it looks: This list Recycler View Layout.xml And My Adapter class file: @Override public void onBindV...
Vignesh
1

votes
1

answer
555

Views

How to make a screen contains google MapView and ListView?

I don't know how to create an custom Activity extending MapActivity and ListActivity ? I am trying screen that contains of google map and list view. How to make it ? Thanks in advance.
Ferdinand
1

votes
1

answer
90

Views

How can data not stored in a DB be accessed from any activity in Android?

I'm passing data to a ListView to display some restaurant names. Now when clicking on an item I'd like to start another activity to display more restaurant data. I'm not sure about how to do it. Shall I pass all the restaurant data in a bundle through the intent object? Or shall I just pass the rest...
jul
1

votes
3

answer
852

Views

Android: HTML links inside ListView - problem with highlighting

I wrote application which uses ListActivity. Each item of the list consists of ImageView and TextView. Long click on list entry triggers some menu and color effect because onCreateContextMenu was overridden. Sometimes TextView contains HTML links which I would like to be interactive. I read #1697908...
boro
1

votes
1

answer
1.1k

Views

Using progress bar ends up in not populating list view

I am using a progress bar in android, so that till my data is loaded, user is getting a proper feedback of what is going on. the code for the bar is below: final ProgressDialog myProgressDialog; myProgressDialog = ProgressDialog.show(ListingPage.this,'Please Wait', 'Loading Date', true); new Thread(...
kaibuki
1

votes
1

answer
217

Views

Using the same view on both tabs in Android

I'm working on an Android application with an activity that uses a tab layout. There are two tabs which switch between the content being shown in a ListView below. This means that the two tab specifications point to the same ListView for content, R.id.main_list: This somewhat works - if I switch to...
Veeti
1

votes
1

answer
894

Views

How to reuse one custom listview activity in another activity?

Can I use my existing ListView as a sub-view in another view. eg. I have a custom view, players list, I have implemented with a ListActivity and ArrayAdapter and is working fine. Now I want a way to get this listview as View object so that I can add this view object as a child to another view. I am...
Venkat Papana
1

votes
2

answer
1.1k

Views

How can I set up an inline ListView?

I'm just starting to develop on Android so this may be a very basic thing, but. . . I'm having a really hard time setting up a ListView within a LinearLayout. Maybe it's a problem in my XML layout, or maybe it's a problem with my databinding code. I'm confused by the many tutorials that say that my...
marclar
1

votes
1

answer
617

Views

Android: 2 different Views means 2 different Activities?

My current application has one Activity, the main one which extends ListActivity (listview of course). The main Activity also holds most of the app functions. I want to add an option for the user to select between 2 views: the current listView and a gridView. I also want to reuse my code - most func...
Lior Iluz
1

votes
2

answer
687

Views

Create clickable item on listview

How to make a clickable item in a listview and get the data directly from the DB when clicking it? Should I use a cursor and get the column names in the cursor??
rogcg
1

votes
2

answer
914

Views

CursorTreeAdapter - Return part of Groupcursor for Childview Data

I'm currently using a CursorTreeAdapter to map a Curser to an ExpandableListView in Android. Everything works fine except from the way data is handled inside the ListView. Generally all the data is already inside the Cursor I give the Constructor of the CursorTreeAdater - even the daa for the Childv...
Johnnycube
1

votes
1

answer
1.8k

Views

How to differentiate read and unread messages in android ListView?

SimpleCursorAdapter is used in my code. Cursor contains field read (true/false). If it is true, then row should be shown with grey text color, if false - with white.
LA_
1

votes
1

answer
651

Views

How to create android Dialog with 2 SingleChoiceItems?

I.e. user should be able to choose values from 2 lists (4 options in each). Ideally it should look like drop down lists.
LA_
1

votes
1

answer
1.5k

Views

List view with customize row layout and base adapter in android

I am creating a ListView. I have created two XML files, in the first one I created a layout, and in the Second xml file - a ListView. I want first layout to be applied to the ListView row.
Tofeeq
1

votes
2

answer
2.1k

Views

Passing listView row positions through Intents to another class

I'm wondering how to pass a row position(pos) value from, say, a CHOICE_MODE_SINGLE list Activity(A) to another Activity(B) using Intents? (I want to change ActivityB to show another list depending on what row in ActivityA is clicked). Here's my code: final ListView listView = getListView(); listV...
Bob
1

votes
2

answer
2.1k

Views

Moving from one ListView Activity to another ListView Activiy

I am using a ListView in Android by creating this class public class HBSListView extends ListActivity; When I click on item in list and I want to go to next ListActivity showing relative details of clicked item in previous list. lv.setOnItemClickListener( new OnItemClickListener() { public void onIt...
Naveed Qamar
1

votes
1

answer
1.2k

Views

Performance issue - ListView, TextView with a Spanned input within each child

Currently I have a ListView with a TextView within each child. That TextView is taking in a Spanned string to populate it. I am using the ViewHolder pattern and I am not parsing the Spanned string in getView(). When I switch from a Spanned string back to just a plain string the performance of the Li...
HandlerExploit
1

votes
1

answer
258

Views

How add additional list to adapters

I have a ListView with separate headers.like..'Today events' is header and below of that it has list.'Tomorrow events' is header and below of that it has some list.These two adapters in a single Listview.My problem is,in Each adapter have more than 20 items but it should display 20 items and when li...
SBK
1

votes
1

answer
161

Views

How can I adapt a cursor to a ListView with a lot of custom behavior?

I'm currently working on an android application that uses a SimpleCursorAdapter with a custom ViewBinder to set specific text color and image visibility on items in my ListView. However, when my list is longer then the size of a screen, and the user scrolls up and down, the system causes incorrect r...
finiteloop
1

votes
1

answer
1.2k

Views

List item container like whatsapp

I'm trying to get this effect on a list item in a list https://ssl.gstatic.com/android/market/com.whatsapp/ss-2-320-480-160-0-a637ec45d9d24eb0f50c610657654007223dbe19 What do I have to do - override a LayoutContainer and implement my own onDraw method? I'm not very good when it comes to graphics/dra...
Jon
1

votes
1

answer
961

Views

Using multiple string resources for different textviews

Hey, I'm currently having trouble with a small Android application I'm making. What I'm attempting to build is: A list interface with Each row having two TextViews (a title and a caption). Have the values of these to be drawn from two separate string array resources. The interface has the following...
Lewis Norton
1

votes
1

answer
357

Views

How to Move to a folder in the external SD card, by specifying the folder path in Android

Please help, how to display the specified folder's contents, when click on a button by specifying the folder's full path.I tried like below, but My application crashes. Button buttonFom = (Button) findViewById(R.id.fom); buttonFom.setOnClickListener(new OnClickListener() { @Override public void onCl...
Tripaty Sahu
1

votes
1

answer
3.2k

Views

make a rich list view of items with thumbnails in android

I am working on an android project for which I need to create a listView. The items in the listView will have a thumbnail, title and a short description. I read up on listViews in android but they only seem to produce a title for an item. How do you create much more richer items?
Abhishek
1

votes
2

answer
314

Views

Android: Getting list row # from child button press

I have a listview of store building locations. Each row contains address, phone, hours, etc. I added a button so that when pressed the dialer intent can be called. My method is called when a button is pressed, but I can't figure out how to get the row #, which I need. Here's what I have. How do...
kireol
1

votes
1

answer
759

Views

listview row custom layout problem

Hi i got the following code that represents a row of my listview. My problem is that between the two textviews ( item_name, item_phone ) there is a space even when the gravity of one is set to bottom and the other to top. I want the text of the item_name right on top of the item_phone, and right now...
Ale K.

View additional questions