adapter

How to use getFilter form Listadapter

泪湿孤枕 提交于 2019-12-11 01:49:33
问题 I try to filter in Listview where the adapter is ListAdapter, I couldn't find getFilter() , Is there any work around? Below is my code. // Adding menuItems to ListView final ListAdapter adapter = new SimpleAdapter(this, songsListData, R.layout.playlist_item, new String[]{"songTitle"}, new int[]{ R.id.songTitle}); setListAdapter(adapter); sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { return false; } @Override public

android clear in costom arrayadapter java.lang.UnsupportedOperationException

送分小仙女□ 提交于 2019-12-11 01:46:38
问题 i want to use clear() in my CostomArrayAdapter , but i get always this error: 09-08 18:15:01.960: E/AndroidRuntime(27192): FATAL EXCEPTION: main 09-08 18:15:01.960: E/AndroidRuntime(27192): java.lang.UnsupportedOperationException 09-08 18:15:01.960: E/AndroidRuntime(27192): at java.util.AbstractList.remove(AbstractList.java:638) 09-08 18:15:01.960: E/AndroidRuntime(27192): at java.util.AbstractList$SimpleListIterator.remove(AbstractList.java:75) 09-08 18:15:01.960: E/AndroidRuntime(27192): at

Jump to the next fragment on any fragment in FragmentStatePagerAdapter

流过昼夜 提交于 2019-12-11 01:35:40
问题 I am using a FragmentStatePagerAdapter in my app. this is my adapter: private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter { List<FeedItem> posts = FeedListFragment.getPosts(); public ScreenSlidePagerAdapter(FragmentManager fragmentManager) { super(fragmentManager); } @Override public Fragment getItem(int position) { FeedItem post = posts.get(position); String url = post.getUrl(); String title = post.getTitle(); String imagUrl = null; if (post.getType() == FeedItem.ARTICLE

RecyclerView not calling getItemCount

末鹿安然 提交于 2019-12-11 00:58:03
问题 I've investigated several SO answers on this question (here, here, and here) and none of the proposed solutions have worked. My problem is that my RecyclerView list items aren't being displayed. I've set breakpoints in MessengerRecyclerAdapter, onCreateViewHolder, onBindViewHolder, and getItemCount and only the first one is ever called. While in a breakpoint I've entered the expression evaluator and executed MessengerRecyclerAdapter.getItemCount(); And received the expected answer of 20. The

ViewPager FragmentStatePagerAdapter keep more than three fragments in memory

别来无恙 提交于 2019-12-11 00:03:15
问题 The problem is ive got sort of book reader, landscape shows two pages and portrait just one. For some reason I blocked destroying activities on config change. the story is pretty much the same like here ViewPager + FragmentStatePagerAdapter + orientation change. Although the question is bit different - Id wish to store not 3 but 5 fragments. its about rendering time, Im easily handling swipe stuffs with adding +-1 in portrait and +-2 in landscape, though the problem is, in landscape

“no method found for type T in the current scope” when wrapping a type

ぃ、小莉子 提交于 2019-12-10 23:39:12
问题 I am trying to make adapters around 2 different types that do the same job and I cannot rewrite the two types. X has a method which consumes self so a run-time polymorphic wrapper is not applicable. The only option is a static generic approach. struct X {} impl X { fn f(self, n: i32) { println!("n = {}", n); } fn new() -> X { X {} } } struct AdapterX { x: X } impl AdapterX { fn uf(self, n: i32) { self.x.f(n) } fn new(x: X) -> AdapterX { AdapterX { x: x } } } fn useAdapted<T>(a: T) { a.uf(10)

Android Listview Position is 0 on item selection

三世轮回 提交于 2019-12-10 22:45:14
问题 I have a custom adapter for my list view (extends ArrayAdapter). The list loads fine. However, when I click on an item in my list, i.e. the 5th item in the list, the position in getView is always 0 instead of 5. It crashes because convertView is no longer null If it is 0, the header variable should be initialized to the R.id.listHeaderTv TextView, but it can't find it and ends up being null. How do I fix the position problem and convertView not being null anymore? EDIT: After checking

Events + Adapter Pattern

对着背影说爱祢 提交于 2019-12-10 21:26:34
问题 I have an adapter pattern on a generic class that essentially adapts between types: class A<T> { event EventHandler e; } class Aadapter<T1, T2> : A<T1> { A<T2> a; Aadapter(A<T2> _a) { a = _a; } } The problem is that A contains an event. I effectively want all event handlers assigned to Adapter to fall through to a. It would be awesome if I could assign the a's event handler to adapter's event handler but this is impossible? The idea here is that A is almost really just A but we need a way to

小型机AIX系统巡检

吃可爱长大的小学妹 提交于 2019-12-10 19:46:16
小型机AIX系统日常巡检目录 一、硬件及外观指示灯巡检 二、系统情况查看 1.设备名、设备型号、产品序列号: 2.处理器 3.内存 4.磁盘 5.适配器 6.分页空间 7.系统镜像(逻辑卷组状态) 8.文件系统 9.错误日志 10.网卡配置情况 11.系统备份 三、网络连通性检查 1.检查各个网卡配置情况及状态 2.检查系统网关是否正确,路由表是否正确 3.检查群集进程是否开启 四、存储巡检 1. 检查外接存储状态 2. 数据库运行状态监听是否正常 3.查看HA双机热备环境 4.查看数据库报错信息 五、检查数据库状态(Oracle) 1.查看数据文件状态 2.查看表空间状态 3.查看表空间空间及使用率 4.检查在线日志状态 5.检查回滚状态 6.检查控制文件状态,输出参数至少3个及以上 7. 查看相关参数文件状态 8.topas 数据库性能查看 9.oracle rac集群查看实力运行状态:crs_stat -t 10.查看oracle数据库服务: 11.查看表空间使用大小: 12.以GB显示查看数据库表空间分配及使用情况及剩余空间情况 一、硬件及外观指示灯巡检 硬件外观指示灯查看,检查系统硬件设备故障灯是否有亮。管理设备为HWC 1.电源 (1)检查主电源灯状态:指示灯常绿表示系统正在运行。 (2)检查直流电源指示灯状态:指示灯常绿表示电源供电正常 2.风扇 检查直流电源风扇状态

ListView doesn't visually update its content after notifyDataSetChanged

旧城冷巷雨未停 提交于 2019-12-10 18:38:20
问题 I have a static array of items which is set to a listview, that I might modify from another Activity (add some more items to it). So when I turn back to first activity, I have to refresh the content of the listview with the new items. I do that by: adapter.notifyDataSetChanged() in the onStart() method, verifying of course if I have to do so. Problem is, I only see my listview changed only if I scroll the list a bit. What could the problem be? LE: Solution was to set listview.invalidateViews(