Questions tagged [baseadapter]

BaseAdapter is an abstract Android adapter class which is used to implement specialized adapters.

From the documentation of the BaseAdapter class:

Common base class of common implementation for an Adapter that can be used in both ListView (by implementing the specialized ListAdapter interface) and Spinner (by implementing the specialized SpinnerAdapter interface).

Tag Usage:

1659 questions
6
votes
1 answer

Custom Calendar and Calendar Adapter

I have a custom calendar, modified from the one seen here. On initial load it shows everything as it is suppose to. However I have two issues. 1.) On the previous month button it goes from August to July as expected but it doesn't clear off all…
jcaruso
  • 2,364
  • 1
  • 31
  • 64
6
votes
1 answer

Android: Change image for a particular item in listview

In the above image, there is a list view which contains list of items that the user can download. This is the image which tells user that he can download the file. On completion of download, the image will change to . My problem is when I download…
Nitish
  • 3,097
  • 13
  • 45
  • 80
6
votes
2 answers

Android: remove divider of some listitems in listview

I've created a listview with a BaseAdapter. I want some of the listitems to have a divider, but from some of the listitems, I want to remove the divider. I know you can remove the divider of the whole list by setting .setDivider(null) and…
Xander
  • 5,487
  • 14
  • 49
  • 77
6
votes
2 answers

ListView, BaseAdapter, getViewTypeCount() - How to force adapter to check again getViewTypeCount()?

I'm using my own BaseAdapter (standingsListAdapter) for the ListView (standingsLV). When I set the Adapter: standingsLV.setAdapter(standingsListAdapter); getViewTypeCount() is called. But later, when I set new data in…
AppiDevo
  • 3,195
  • 3
  • 33
  • 51
6
votes
2 answers

MultiAutoCompleteTextView with Custom Adapter displays garbled string

This is a follow up to my question earlier here: Android: Autocomplete TextView Similar To The Facebook App. The Background: My requirement in the question (link posted above) was to have an AutoCompleteTextView similar to the one used in the…
Siddharth Lele
  • 27,623
  • 15
  • 98
  • 151
6
votes
2 answers

Why is my BaseAdapter class not incrementing the position in getView?

Edit: My issue seems like BaseAdapter just wont post more than 1 Spinner. If I change the array's size to 0, it wont put anything, but anything more than 1 is truncating it. It never passes position 0 from getView() and it never shwows anymore than…
Andy
  • 10,553
  • 21
  • 75
  • 125
6
votes
3 answers

how to display custom listview using list fragments in android

I have divided my android screen into 2 fragements .In the first one I make a listview from server database to android mobile.The problem is that I can't call getview method in the base adapter class. Do help me out public class MyListFragment1…
naveen
  • 721
  • 3
  • 11
  • 16
5
votes
1 answer

Calling Android's BaseAdapter notifyDataSetChanged() from a listener callback method

I've been struggling with this for some time now. In my project there are several Activities that include a ListView and a custom adapter extending BaseAdapter. They also implement some interfaces which usually inform it that the data has been…
PawelPredki
  • 754
  • 1
  • 12
  • 26
5
votes
2 answers

ListView with a custom adapter, adding elements one by one

Reading this question, I tried the example given in the answer and it's working fine. Now I want to do the same but with a custom adapter using a Student class. So I have: public class AsyncDemo extends ListActivity { private static final String[]…
tweetysat
  • 2,187
  • 14
  • 38
  • 75
5
votes
2 answers

BaseAdapter vs CursorAdapter

I would like to know when to use each Adapter. According to my experience, and this article BaseAdapters are useful when I am getting data from an API for example, and I store it in a Collection object. However a CursorAdapter is used to query…
Dayerman
  • 3,973
  • 6
  • 38
  • 54
5
votes
2 answers

Common adapter for spinner and recyclerView

Can write common adapter for different views? I am interested in common adapter for recyclerView and spinner. In my project i have RecyclerView and Spinner and i want to write base generic adapter for both (RecyclerView and Spinner) Can you help me?
Sky
  • 521
  • 1
  • 5
  • 14
5
votes
6 answers

ListView setText on particular position

I defined the following code to be able to set text in a certain position. if(position == 0) { holder.text.setText("blah"); } What I would like is to check if the position is equals 0, and then if it is, set text on…
dynamitem
  • 1,647
  • 6
  • 25
  • 45
5
votes
1 answer

Adding favorite button in list view

I have a listview which has a favorite button for every list item which when clicked should add the list item to another activity called my fav9rites. I am using a Baseadapter for the listview and Sharedpreference for adding favorites. When I click…
5
votes
1 answer

Linkify inconsistency

I have a list with photos like Instagram, with text that has links to hashtags and users using # and @ and I'm using Linkify to make this work. The 1st item in my list gets the links correct 8/10 times but the other times its just plain text. The…
Jonas Borggren
  • 2,591
  • 1
  • 22
  • 40
5
votes
5 answers

How to Call Adapter class before Activity

Log says: D/CartActivity-onCreate(18171): onCreate D/CartActivity-TOTAL-InsideFORLOOP:(18171): 0.0 D/CartActivity-onResume(18171): onResume D/CartAdapter-TOTAL:(18171): 12.95 As you can see in above Log for loop is executed first in CartActivity…
Sun
  • 6,768
  • 25
  • 76
  • 131