android-adapter

Android Realm Abstract Class Instantiate

妖精的绣舞 提交于 2019-12-12 03:11:31
问题 I am trying to setup an AuotoCompleteTextview (in my MainActivity) where data is fetched from Realm database. So I'm using an adapter as following: public abstract class FilterableRealmBaseAdapter<T extends RealmObject> extends ArrayAdapter<T> implements Filterable { private final RealmResults<T> mRealmObjectList; private List<T> mResults; public FilterableRealmBaseAdapter(Context context, @LayoutRes int layout, RealmResults<T> realmObjectList) { super(context, layout); mRealmObjectList =

No adapter attached; skipping layout recyclerview

无人久伴 提交于 2019-12-12 02:38:38
问题 the images are not displaying. in a SO example said to check the count in the adapter, but i think its correct. I am getting this error in the logcat No adapter attached; skipping layout recyclerview this is the code mainactivity RecyclerOkHttpHandler handler = new RecyclerOkHttpHandler( this, new RecyclerOkHttpHandler.MyInterface() { @Override public void myMethod(ArrayList result) { mAdapter = new MyAdapter(result,Search.this); mAdapter.notifyDataSetChanged(); mRecyclerView.setAdapter

Restore Fragment default values onswipe

独自空忆成欢 提交于 2019-12-12 02:37:39
问题 there are to many threads talking about this but i tried everything and doens't seem to work. My Problem is kinda simple i have a viewpager with 5 fragments pages. Each of this fragment has the same layout only 1 edit text, and the issue is if i write something on the editext onswipe to next or the previous page i would like to reset that edittext. For example: PAGE1: editext=2929 ---(swipe)--- PAGE2: edittext = 0 ----(swipe)--- PAGE1:edittext = 0 But it always shows the 2929. I to do this

implementing getFilter(). into custom ArrayAdapter with AsyncTask

我的未来我决定 提交于 2019-12-12 01:59:22
问题 i´m newbie in android programming and try to implement getFilter() into my custom ArrayAdapter an filter the List by Name. I have not found any example that matches with my adapter. Can someone help me with an example please (with my code), thx!!! Maybe there is another possibility to filter the List? java code: public class c_DTArtikel_allforsearch extends Activity implements AdapterView.OnItemClickListener { private ListView ListViewLayout; private EditText search; private String[] Name;

Footer Image Will Not Size Correctly

久未见 提交于 2019-12-11 23:15:13
问题 I have a footer image which does not seem to size correctly: it is cut off on every side and appears to overlap with other images (assigned to the PagerAdapter as well). How can this be avoided? Screenshot: JAVA SNIPPET: private class ImagePagerAdapter extends PagerAdapter { private int[] mImages = new int[] { R.drawable.classical_up_btn, R.drawable.country_up_btn, R.drawable.dance_up_btn, R.drawable.hiphop_up_btn }; public int getCount() { return mImages.length; } public boolean

I can't get data from Firebase in fragment with custom adapter

帅比萌擦擦* 提交于 2019-12-11 22:59:44
问题 My code work without error, but i can't get data from Firebase, i use custom adapter for fragment and when i open fragment there are empty. I don't know what i need do. P.S when i use code in Activity all work. In Manifest i have all permissions. Other Activity where need get data from Firebase, working very well. My code Fragment public class ChatList extends Fragment implements ContactsAdapter.iData, InboxAdapter.inbox_data{ LinearLayoutManager messageLayoutManager,contactsLayoutManager;

ListView updates only when activity restarts - Android

安稳与你 提交于 2019-12-11 22:25:16
问题 Hi i have provided my code below. I have one Main UI thread and one manual thread. I am updating the listView inside the thread and using it in an adapter and list view to populate. But the problem is once the activity starts the list is empty and only when the configuration changed it gets updated with the adapter. whats the problem in it? My thread is starting only after the oncreate is complete? Kindly leave the cursor part as I am getting all the values very well. Kindly help me friends.

Unable to modify values in ListView

十年热恋 提交于 2019-12-11 20:49:53
问题 I'm faced with this problem java.lang.UnsupportedOperationException What I want to do is easy, I'll show you an example. MyList Blue Red Green When I make an OnItemLongClickListener() for example on Green , my list should looks like : MyList Green What I've tried is final ArrayAdapter < String > adapter = new ArrayAdapter < String > (getActivity(), android.R.layout.simple_list_item_1, FileBackup.getFilesFound()); adapter.setNotifyOnChange(true); lv.setAdapter(adapter); lv

How to change text color on button in BaseAdapter?

断了今生、忘了曾经 提交于 2019-12-11 19:51:31
问题 How can you change the color of the name in the button so that everyone is not in the same color for a specific letter in the BaseAdapter, where in the view I create buttons? At the moment, in the getView () method, I check if the answer is empty, if so I set the default blue color and everything is fine, but I would like to distinguish when the list is full for a specific index list let's say 3,6,7 set a different text color than green as in the current example. public class

send message to Calling listFragment from Custom Adapter

有些话、适合烂在心里 提交于 2019-12-11 19:23:30
问题 I have a ListFragment , which will display a list of news feed items. I'm doing an asyncTask to get 20 feeds initially, then I need to do another call to get next 20 feeds , only if the user has done reading first 20. I.e My Adapter should notify my fragment that it needs next feeds. This is my present code (AsyncTask of myListFragment) . @Override protected void onPostExecute(Object result) { List<PublicFeed> feedItemsList = (List<PublicFeed>) result; listener = new ScrollListener();