Questions tagged [getview]

To be used with the android tag. Refers to the getview(int position, View convertView, ViewGroup parent) method in the adapter class and other methods related to this. Add any other tags relevant to the question.

To be used with the . Refers to the getview(int position, View convertView, ViewGroup parent) method in the adapter class and other methods related to this. Use any other tags that are relevant to the question.

247 questions
1
vote
1 answer

Android GridView drawing layout

I want to achieve following Image design by using GridView, i have tried with these lines of code but I failed to get blank spaces between 5 and 6, 15 and 16 and so on as it is showing in design. public View getView(int position, View convertView,…
Fakhar
  • 3,946
  • 39
  • 35
1
vote
0 answers

How to get value of current array adapter position other than in getView

I am using a cardstack through an array adapter. I am using getter setters to display the data on the card. But I am also getting back the duration of a the song that is associated with the card with getSongDuration(). The problem is when this loads…
Nicholas Muir
  • 2,897
  • 8
  • 39
  • 89
1
vote
1 answer

GetView Called Multiple times

I have seen several other questions regarding GetView being called in an adapter several times and causing performance issues. However, this question is not a duplicate. All of the answers I have found mention that having a ListView with a height of…
Jeff Fennell
  • 41
  • 1
  • 5
1
vote
2 answers

Custom Base Adapter to ListView

I have tried so many different tutorials trying to get it work I'm wondering if something is wrong with my machine.. This is my MainActivity where I create myadapter and set it to the ListView. public class MainActivity extends Activity { UserRepo…
1
vote
1 answer

CustomAdapter / getView() called only once?

why the getView method called only once ? and return nothing ? here is my code public class GridViewAdapter extends BaseAdapter { Context mContext; ArrayList list; GridViewAdapter(Context context,ArrayList list){ this.mContext…
Mohamed Yehia
  • 400
  • 1
  • 5
  • 15
1
vote
3 answers

ArrayAdapter getview is not being called though getCount is getting called

ArrayAdapter getView not getting called, whereas getCount returns listsize. I have applied setAdapter(null) before setting adapter with original list items on list to set adapter but it is not working. And also tried BaseAdapter for the same, but…
Narendra Singh
  • 3,990
  • 5
  • 37
  • 78
1
vote
1 answer

Error using getView() with a Listview

I'm am a newbie with Android development and using the following example to do something similar: https://stackoverflow.com/a/11626706/5724649 But am getting the following error: "Attempt to invoke virtual method 'java.lang.Object…
1
vote
1 answer

EditText setOnKeyListener not working when value changes

Here's my code : private EditText EditHal; .... .... @Override public View getView(int position, View convertView, ViewGroup parent) { layout = convertView; if (convertView == null) { layout = inflater.inflate(R.layout.my_fragment,…
wdyz
  • 185
  • 4
  • 19
1
vote
0 answers

Not able to select correct Image due to incorrect position value of getView in Adapter extending ArrayAdapter

I am trying to create a gridView of scrollable images for my android app.Each Grid consist of imageView. When one clicks on the image, then it blurs the image and present Play & share options.I am using the ArrayAdapter with holder pattern to set…
1
vote
2 answers

How to implement selectable ListView with EditText in ListItem in Android

I'm trying to implement a custom list view which has list items with spinner and edittext. And the list item needs to be selectable, also the edittext in list item needs to be editable. But the problem is when I set the edittext editable with…
genki98
  • 680
  • 1
  • 11
  • 31
1
vote
3 answers

Android adapter's getView() not calling an activity

I am trying to call an activity from adapter class. My activity class has no constructor but onCreate(). How do I call it from getView()? I searched for solutions but it's not working. My adapter getView(): public View getView(int position, View…
spykeburn
  • 153
  • 1
  • 19
1
vote
3 answers

Access View from listener or custom function

Hello I'm learning how GPS works in Android (And generally android :) ), and I'm trying to access my View from a listener and I can't, I need to update my TextView in "onGpsStatusChanged" and I don't have my View there, So, For example, in this…
Eran Levi
  • 363
  • 7
  • 22
1
vote
0 answers

Gridview extend baseadapter ,the getView method called many times that onLoadingComplete superfluous repeat image added to tempSelectBitmap array list

Grid view using universal image load, when I debug find the getView method called many times even mImageUrlList just have one item. And in Onloadingcomplete method, tempSelectBitmap arraylsit add superfluous repeat images. I have no idea what wrong…
Gang Luo
  • 51
  • 6
1
vote
1 answer

getView showing random items when scrolling

I have my class PlannerListAdapter that extends BaseAdapter and i have 2 problems in my getView() method. 1) When i set my adapter to the listview, everything it's ok, the listview show me all the elements i have in my List, I scroll down and i…
1
vote
0 answers

How to keep the already Loaded Images in the Gridview after Scrolling in Android

I have a GridView that shows images from a sdcard. I use AsyncTask in the getview() method (getview loads the bitmap in AsyncTask) from this tutorial. GridView scrolling is fast and loads the images in Gridview fast and positions it correctly but my…