Questions tagged [simpleadapter]

SimpleAdapter is a basic Android adapter which can be used to map static data to views in a xml layout.

A SimpleAdapter expects that the data supplied to be in the form of a List of Maps, where each Map represents the data for one row. The SimpleAdapter is a limited adapter by default, it will only bind data to an ImageView or TextView, for any other views the user must either use a ViewBinder or override the adapter's default behavior. More can be found in the documentation of the SimpleAdapter.

334 questions
21
votes
2 answers

Choose between ArrayAdapter and SimpleAdapter

I was wondering, is there any guideline, on how we choose between ArrayAdapter and SimpleAdapter. For every list item, they will be presented by several TextViews and Views, which is being layout nicely. I realize I can implement both without any…
Cheok Yan Cheng
  • 49,649
  • 117
  • 410
  • 768
8
votes
4 answers

Change text color in android.R.layout.simple_list_item_2

I'm using a simple adapter to display my code. Unfortunately, I need to change the top textView color. This is a snippet of my code: // Keys used in Hashmap String[] from = { "txt1", "txt2" }; // Ids of views in listview_layout int[] ids = {…
EGHDK
  • 16,593
  • 41
  • 119
  • 199
7
votes
1 answer

Using SimpleAdapter with Spinner

I am new to Android development. I am trying to populate a spinner by using the SimpleAdapter. But spinner's list is showing blank element. When I click any element, its text is shown properly in Toast. Please tell me what is the problem in my code…
Chromium
  • 1,333
  • 1
  • 9
  • 24
7
votes
3 answers

How to show images in imageview in simple adapter?

I am getting data from JSON Array and I can show the text in textviews but having problems with showing the images. here's the main activity: public class test extends ListActivity { // url to make request private static String url =…
Alaa
  • 769
  • 7
  • 9
6
votes
4 answers

How to set a simple adapter to listview?

I have problem adding arraylist to list view, will explain about my problem here.. tell me what is wrong here... I have three linear layouts, and in the middle layout i have list view, as shown in the xml file below.. `
Prady
  • 633
  • 3
  • 8
  • 25
5
votes
2 answers

Android : How to Refresh list upon item deletion in customized SimpleAdapter

May i know how to refresh the ListView item after i have remove a map list item in customized SimpleAdapter ? I have successfully implement the delete list item with list.remove(position), but when I have tried to called list.notifyAll() function…
johnteow
  • 53
  • 1
  • 5
5
votes
4 answers

How to get the item id in an onItemClick handler

I have a category table with two columns category_id and name. I have created a data helper class named CategoryDataHelper. I have a method named getCategoryCursor() of that helper class which fetches the id and the name from the category table and…
dev_android
  • 7,874
  • 21
  • 84
  • 143
5
votes
7 answers

Android: Display image in imageview by SimpleAdapter

I am new android now I want to display image from an url. I am using imageview in listview. I want to add the list of images into the each row of the list item. I used SimpleAdapter but the imageview shows blank. Here's the main activity: package…
5
votes
1 answer

I want a Imageview inside SimpleAdapter?

Could someone point me in the right direction to get a ImageView inside this SimpleAdapter? The TAG_IMAGE should be the Imageview. I am getting this: Type missmatch: Cannot convert from ImageView to int. And yes I am a noob. protected void…
David Poulsen
  • 51
  • 1
  • 3
5
votes
1 answer

Better understanding of the SimpleAdapter's ViewBinder

I have 4 TextViews, 2 ImageViews, 2 Buttons and 2 widgets that are part of a row definition in a ListView. The data comes from XML and a SimpleAdapter. To access these TextViews I implement the ViewBinder in a custom class and override the…
GPGVM
  • 4,659
  • 8
  • 50
  • 90
4
votes
2 answers

Cannot use SimpleAdapter on a ListFragment

I'm developing a ListView in an Android Fragment. The class extends ListFragment. I tried with this example: http://www.heikkitoivonen.net/blog/2009/02/15/multicolumn-listview-in-android/ but the problem is that constructor SimpleAdapter is not…
Michelh91
  • 276
  • 4
  • 11
4
votes
1 answer

Populating Spinner with SimpleAdapter in Android

I have used ArrayAdapter to populate the Spinner. I want to know if it can be done using a SimpleAdapter? Please guide me in the right direction. Thanks in advance.
Mudassir
  • 13,962
  • 8
  • 60
  • 85
4
votes
2 answers

Image in row of recyclerview disappears after rotation

In my recyclerview I set an image (in recyclerview row) visible or not visible according some condition. However after I rotate the screen the image disappears, how do I keep the image visible on it`s position in the recyclerview after rotating the…
Simon
  • 1,531
  • 2
  • 9
  • 24
4
votes
2 answers

How to get selected item position from Spinner using SimpleAdapter

I have a spinner, which is populated using below code, I want to get the item selected by user from spinner. What is the best way for this ? List> tablelist = new ArrayList<>(); SQLiteDatabase db =…
Mark Dev
  • 151
  • 1
  • 5
4
votes
1 answer

How to enable scrolling on a simpleadapter on Google Glass's firmware X16

After updating my Google Glass up to XE16 my listview, which I have built by using a simpleadapter, is not able to scroll anymore. Is there a way to manually enable scrolling nonetheless with the GDK or fix this issue?
BarryK88
  • 1,786
  • 2
  • 24
  • 41
1
2 3
22 23