android-adapterview
gridView with different cells sizes, pinterest style
Is it a bit late to answer? check this library from etsy. it looks very promising. https://github.com/etsy/AndroidStaggeredGrid I think it is newer version of https://github.com/maurycyw/StaggeredGridView . Updated. Try using RecyclerView StaggeredGridLayoutManager from google instead RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view); recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL)); recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setAdapter(adapter);
Correct use of setEmtpyView in AdapterView
You need to add this same view in the layout in which you have added the AdapterView. AdapterView only changes its visibility based on the contents in the adapter. EDITED : Following layout and code works fine : <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”fill_parent” android:layout_height=”fill_parent”> <ListView android:layout_width=”fill_parent” android:layout_height=”300dip” android:id=”@+id/list_view” /> <TextView android:id=”@+id/empty_list_view” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”List view is … Read more
Unable to start activity:UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView
what should i do??? Correct your code. UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView A subclass of AdapterView like a ListView can’t have children manually added either in the layout file or added in code. So if you have this in one of your layouts: <ListView // .. other attributes> <// other views <– … Read more
How to get text from AutoCompleteTextView?
Yeah… unfortunately the name of the parameters on the onItemClick method you must implement are not so self-descriptive but here is an example with the names of what they are: autoCompleteTextView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long rowId) { String selection = (String)parent.getItemAtPosition(position); //TODO Do something with the selected text … Read more
Difference between onItemClickListener and OnItemSelectedListener of AdapterView
OnItemSelectedListener is used for Spinners, and OnItemClickListener is used for ListViews.
Logcat error: “addView(View, LayoutParams) is not supported in AdapterView” in a ListView
For others who have this problem and have inflated a layout in ArrayAdapter‘s getView, set the parent parameter to null, as in view = inflater.inflate(R.layout.mylayout, null);
Spinner: get state or get notified when opens
Another option to watch for those events is to extend the Spinner class and use one of its methods(performClick() which will trigger its dialog/popup) followed by monitoring the focus of the window holding this custom Spinner. This should provide you with the wanted closed event for all the possible finishing possibilities(for either the dialog or … Read more
ExpandableListView -UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView
Seems like Adapterview does not allow adding new view, I encountered same problem Solve it by replacing following line convertView = inflator.inflate(R.layout.child_rows, parent); to convertView = inflator.inflate(R.layout.child_rows, null); UPDATE Instead of not using a parent at all, you should simply tell the Inflater not to attach the inflated view to the parent with convertView = … Read more