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
13
votes
1 answer

dont stop the animation in listview

i'm working with AnimationDrawable for download progressBar i put the animation in getview an it's working fine. but when i'm scrolling the list the animation has been stoped. is there any method in AnimationDrawable to fix this. like setCancelable…
hamedjj
  • 658
  • 6
  • 20
10
votes
1 answer

NullPointerException Warning on getView() inside onActivityCreated/onStart/onViewCreated method

I know getView() might return null inside onCreateView() method, but even if I put the below code inside onActivityCreated(), onStart() or onViewCreated() methods, it still shows the warning about a possible NullPointerException in Android Studio…
abdfahim
  • 2,523
  • 10
  • 35
  • 71
7
votes
2 answers

What is the difference between getView() and getActivity()?

What is the difference between getView() and getActivity()? I have used both methods but don't understand the basic difference even methodology of usage are also same in android: ListView deliverItemList = (ListView)…
Abdul Rahman Majeed
  • 1,125
  • 2
  • 10
  • 22
7
votes
1 answer

ListView with multiple types of row layout - BaseAdapter is not working properly in Android

Hi below is my class for baseadapter, but it is not working properly: private static class MyBaseAdapter extends BaseAdapter { private Context context; private LayoutInflater inflater; private MyBaseAdapter(Context…
Vinay Raut
  • 119
  • 2
  • 10
6
votes
3 answers

Android ListView with multiple layouts

I have to show a list with different type of Views. So I have to define a ListView with an Adapter where I have to inflate multiple views. I have gone through example given, but problem is for my list is not symmetric like the example where header…
dev_android
  • 8,698
  • 22
  • 91
  • 148
5
votes
4 answers

Android customAdapter (BasesAdapter) getView is always returning 0

I have made a customadapter for a listview, but for some reason the getView method's parameter "position" is always 0, which makes the method pretty useless. Here is the code of my customAdapter, extending BaseAdapter: public class…
Langkiller
  • 3,377
  • 13
  • 43
  • 72
4
votes
3 answers

Make first ListView item appear in a different layout

I'm trying to make a ListView with the first item displayed in a different layout, and others in a common layout. Both layouts have the same elements which in pairs have the same names. When I do like this: public View getView(int position, View…
Mr. Kro
  • 138
  • 9
3
votes
3 answers

'getView' overrides nothing

I am new about android studio. I tried to use ArrayAdapter. But when i complete my codes, it says "'getView' overrides nothing".I getting this error in "return teksatirview code. this is my arrayadapter class: package com.example.burcrehberi import…
akiilhan
  • 169
  • 4
  • 13
3
votes
0 answers

getView return wrong value from getItemViewType

I've been having this problem for few days,it seems like the return value i get from "getItemViewType" did not passed to "getView" correctly. When i debugged it, it return first "final_value" then supposedly should go to "getView" but it didnt,…
Old G
  • 366
  • 1
  • 4
  • 9
3
votes
1 answer

How to use AsyncTask with ListView Adapter

So, I have a ListView which I'm showing on my TodayFragment. There are TodayTaskAdapter, that customises this list. When the actvity is loading, it takes a lot of time because of the list. And slows down app. The question is: How should I use…
3
votes
3 answers

Finish or destroy of activity on clicking of Listview button after starting of Another activity

I have an Activity ListActivity having Listview and another class CustomListAdapter extends BaseAdapter. Code in ListActivity customAdapter = new CustomListAdapter(list); TripList.setAdapter(customAdapter); In getView() of CustomListAdapter I…
manjari
  • 183
  • 1
  • 14
3
votes
3 answers

Why are wrong images getting loaded in ListView occasionally?

I have a listview which loads images in every cell in async. When I try to scroll down slowly(after all the images in the current view are loaded), it works flawlessly. But when I try to scroll down before they are even loaded and scroll up, I face…
3
votes
2 answers

How to start display a list-view from specific item position

I have a list view of 300 mp3 songs and suppose song 52 is playing. So I want next time when user opens the list of song, the list row in front of him must starts from row 52 (while up and down are still rows). I tried using public View…
user1460340
3
votes
3 answers

Android: getView in adapter never called

Still geting my head around how adapters work and the structure. Im trying to show text (from server) in xml and the user should be able to edit that text and then send it back (to server). Little confused with AutoCompleteTextView and EditText.…
Sindri Þór
  • 2,887
  • 3
  • 26
  • 32
2
votes
2 answers

Show check mark in selected item of ListView

I am trying to create a language selecting screen. I have a ListView and I am using custom adapter class. Upon selecting an item, I want to show a tick mark in the item. My ListView have a TextView` and an ImageView. How to achieve it? Here is what…
Siru malayil
  • 197
  • 2
  • 11
1
2 3
16 17