Questions tagged [android-adapterview]

An AdapterView in android is a view whose children are determined by an Adapter.

An AdapterView in android is a view whose children are determined by an Adapter. Examples of AdapterView include:

  • ListView
  • GridView
  • Spinner
  • Gallery

Useful links

286 questions
63
votes
4 answers

Android. How does notifyDataSetChanged() method and ListViews work?

I am trying to understand the ListView concept and how it works and I'm trying to create my own adapter which extends BaseAdapter. For ArrayAdapter for instance, there is the notifyDataSetChanged() method which should be called after you've updated…
AndreiBogdan
  • 10,858
  • 13
  • 58
  • 106
59
votes
5 answers

ExpandableListView -UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView

I am implementing Expandable List view in android and i am getting the above titled error. Please help me. Main activity is - package com.expand; import android.app.Activity; import android.os.Bundle; import android.util.DisplayMetrics; import…
Gaurav Arora
  • 8,282
  • 21
  • 88
  • 143
58
votes
8 answers

Spinner: get state or get notified when opens

Is it possible to know whether a Spinner is open or closed? It would even be better if there was some sort of onOpenListener for Spinners. I've tried using an OnItemSelectedListener like this: spinnerType.setOnItemSelectedListener(new…
dumazy
  • 13,857
  • 12
  • 66
  • 113
52
votes
6 answers

Logcat error: "addView(View, LayoutParams) is not supported in AdapterView" in a ListView

I'm doing an application for Android and something I need is that it shows a list of all files and directories in the SD Card and it has to be able to move through the different directories. I found a good tutorial in anddev. I modified a few things…
Alberto Elias
  • 891
  • 2
  • 8
  • 17
48
votes
3 answers

Difference between onItemClickListener and OnItemSelectedListener of AdapterView

What is the difference between these two listeners,documentation says : OnItemSelectedListener - Interface definition for a callback to be invoked when an item in this view has been selected. OnItemClickListener - Interface definition for a callback…
Suresh
  • 9,495
  • 14
  • 49
  • 63
42
votes
11 answers

How to get text from AutoCompleteTextView?

I have an AutoCompleteTextView in my app which works. I have successfully created an onClickItemListener. The question is how to grab the text the user selected. And this is the thing: I have an ArrayList with words being passed to the Adapter to…
madcoderz
  • 4,423
  • 10
  • 47
  • 74
41
votes
5 answers

Unable to start activity:UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView

I want to write a ListView in basic format but I get an error: UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView and: androidview.LayoutInfalater.inflate(LayoutInflater.java: some numbers....like…
elegance
  • 711
  • 2
  • 8
  • 17
39
votes
5 answers

Correct use of setEmtpyView in AdapterView

I'm really having trouble using the setEmptyView method. I tried it to implement it in GridView and ListView, but both of them didnt work. Here a sample codeblock: networkGames = (GridView) baseLayer.findViewById(R.id.all_game_grid_network); …
RoflcoptrException
  • 51,941
  • 35
  • 152
  • 200
36
votes
3 answers

gridView with different cells sizes, pinterest style

Background GridView is a class that extends AdapterView , which means it shows cells in a grid-style efficiently, recycling old views to be shown as new ones when the user scrolls it. The problem Sometimes, you would want to get a special UI, which…
34
votes
5 answers

Android AdapterView?

Documents say: When the content for your layout is dynamic or not pre-determined, you can use a layout that subclasses AdapterView to populate the layout with views at runtime. A subclass of the AdapterView class uses an Adapter to bind data…
Student Student
  • 960
  • 2
  • 14
  • 24
32
votes
2 answers

What does AdapterView mean in the OnitemClick() Method? What is the use of other parameters in it?

gridview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position, long id) { Toast.makeText(HelloGridView.this, "" + position, Toast.LENGTH_SHORT).show(); } …
Nandagopal T
  • 2,037
  • 9
  • 42
  • 54
17
votes
7 answers

how to get object from listview in setOnItemClickListener in android?

I have added arraylist in arrayadapter which contains objects each consists of two elements/items, I have successfully set that adapter for setListAdapter, now i want to get those items in setOnItemClickListener of listview. here is my code …
Ramamoorthy
  • 287
  • 3
  • 6
  • 10
14
votes
3 answers

Extending AdapterView

i'm trying to make (for learning purposes) my own implementation of a simple AdapterView where items comes from an basic Adapter (ImageAdapter from sdk samples). Actual code is like this: public class MyAdapterView extends…
Ander Webbs
  • 1,158
  • 1
  • 8
  • 11
11
votes
2 answers

RecyclerView - Where should I handle its click events?

Prior to the introduction of RecyclerView (and its mandatory ViewHolder pattern), I usually delegate any click events to its corresponding Activity/Fragment using setOnItemClickListener(). (Because I mainly see Activity/Fragment as a "controller"…
Hadi Satrio
  • 4,272
  • 2
  • 24
  • 45
11
votes
3 answers

removeView(View) is not supported in AdapterView

I want to delete a certain row from a listView when an ImageView is clicked. My listview looks like this : I want that when the last image is clicked to delete that row. Here is my adapter : public class UserItemAdapter extends…
Gabrielle
  • 4,933
  • 13
  • 62
  • 122
1
2 3
18 19