getview

'outofmemoryerror' in the getView() from custom BaseAdapter

邮差的信 提交于 2019-12-25 16:55:39
问题 I have an Activity with a grid layout where display images from SD folders. When I select a folder, all images are added to a String list (clean when folder is changed), and images construction is in getView() method, using these strings from the list. It works properly for 5 or 6 times (images from folder are displayed), but then I change the folder and I get an 'outofmemoryerror' in the getView() from the custom BaseAdapter (see code line), but I don't understand my leak problem... Images

How to get getItemAtPosition in getView?

本秂侑毒 提交于 2019-12-25 06:14:09
问题 I have ImageView with listItems from db, and every list items have two Buttons (add friend/rejectFriend). I am also using CursorAdapter , and inside of my adapter I have getView() method to set listeners and catch clicks on current item Button . and here the question: I need to get some data from db for current item, when i catch click on item Button (add friend for example). so with help of getView() parameters I can get the position of ListView item, but how from getView() correct call

getView showing random items when scrolling

流过昼夜 提交于 2019-12-23 01:41:45
问题 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 can see all the elements of the list. But when i scroll up, the elements starts to switch each other and also are being repeated, also, it is changing me the order of the elements, why is this happening? 2) In my BrandPlannersList i have a String[]

Why are wrong images getting loaded in ListView occasionally?

天大地大妈咪最大 提交于 2019-12-21 20:46:44
问题 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 this issue. The cells start to show up images which don't correspond to them. My getView method looks like this: public View getView(final int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub View rowView = null;

TextView is null

十年热恋 提交于 2019-12-20 06:15:47
问题 I'm having a problem with TextView. After pressing a button I want to append something to that TextView but apparently is null all the time. fragment_one.xml .... <TextView android:id="@+id/reply" android:layout_below="@+id/test" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/reply"/> <Button android:text="@string/_0" android:id="@+id/_0" android:onClick="handleButtons"/> .... ActivityTwo.java .... public void handleButtons(View v){

Click Method inside Getview Called multiple times

冷暖自知 提交于 2019-12-14 04:20:01
问题 I want click method to be called only once, what can I do get this result? here's my code: public override View GetView(int position, View convertView, ViewGroup parent) { View result = convertView; if (result == null) { result = LayoutInflater.From(_Context).Inflate(Resource.Layout.DiagnoseTemplateLayout, null, false); } TextView textView = result.FindViewById<TextView>(Resource.Id.DiagnoseTemplateTextView); textView.Text = _Diagnoses[position].Description; Button button = result

I get more than one id in one click (ListView custom adapter GetView)

蹲街弑〆低调 提交于 2019-12-11 17:45:38
问题 I want to do that when I click a ToggleButton from the list, retrieve the ID of the row textview. The problem is that when most IDS pulse are obtained, and when I scroll too ... I do not know what to do! I get all these IDS in my LogCat.. with only ONE CLICK on the position "adeww" My MyAdapter code is here: public class MyAdapter extends ArrayAdapter<Usuari>{ private final List<Usuari> list; private final Activity context; public MyAdapter(Activity context, List<Usuari> list) { super(context

Universal Image Loader - call too many getView()

十年热恋 提交于 2019-12-10 12:19:41
问题 I'm trying to create a image ListView using universal-image-loader. Currently, no images appear or load. I found that getView() from ImageAdapter was called to many times. For example, if list size is 3, then getView() should call 3 times but in my code, call 24 times!!! This is my Source Code. public class MainActivity extends Activity{ AsyncTask<Void, Void, Void> asyncTask, registerTask; DisplayImageOptions options; ArrayList<HashMap<String, Object>> feedList = null; @Override public void

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

核能气质少年 提交于 2019-12-08 19:10:58
问题 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 context, FlipViewController controller) { inflater = LayoutInflater.from(context); this.context = context; } @Override public int getCount() { return Globals.list_album.size(); } @Override public Object getItem(int position) { return position; } @Override public long getItemId(int

getView showing random items when scrolling

拈花ヽ惹草 提交于 2019-12-06 20:16:29
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 can see all the elements of the list. But when i scroll up, the elements starts to switch each other and also are being repeated, also, it is changing me the order of the elements, why is this happening? 2) In my BrandPlannersList i have a String[] socialNetworks object. I want to change the social networks (twitter, facebook, instagram) default image