adapter

Io 异常 The Network Adapter could not establish the connection的三种解决方法

删除回忆录丶 提交于 2020-01-09 07:54:35
1.IP错误或端口错误。 在设置URL时错误,例如:jdbc:oracle:thin:@192.168.0.36:1521:sharp 数据库服务器不正确:ping 服务器IP是否正确。不正确,将URL更改为正确 端口号错误:一般不会错误但可能使用多个oracle版本,导致端口号为1522的情况。 进行一下操作:在DOS上键入sqlplus,检查oracle是否开启 一却正常,执行下面第2步。 2.防火墙 如果机器上安装有放火墙,可能是服务器端口号屏蔽而造成的。关闭防火墙后,尝试重新连接。 仍然不行,执行第3步。 3.数据库监听未启动 我下面以现在主流的数据库ORACLE为例 重新手动启动数据库监听: 1:开始 → 运行→ 输入CMD→ 进入DOS命令提示界面 d:>lsnrctl LSNRCTL> status 或者 LSNRCTL> start 注 : 可能服务器上有多个监听,默认lsnrctl start启动的是 LISTENER这个监听, 查看其他监听可以搜索listener.ora这个文件。看看是否有其他的监听,如果有,使用lsnrctl start 监听名字。 # listener.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin

Values of counter changes after scrolling ExpendableListView

自闭症网瘾萝莉.ら 提交于 2020-01-09 03:57:12
问题 I have an ExpandableListView of items and on list item I have TextView with two buttons to increment or decrements the value in TextView on clicks. The problem occurs every time I try to scroll the list. If I increment one item and then scroll the list the values get mixed (becouse the ListView keeps recycling its views) and I don't know how to fix it. I have tried many soulutions I have found here, so yes this may be a duplicate, but I wasn't able to solve my problem with any method I have

Logcat error: “addView(View, LayoutParams) is not supported in AdapterView” in a ListView

自闭症网瘾萝莉.ら 提交于 2020-01-09 03:23:09
问题 I'm doing an application for Android and something I need is that it shows a list of all files and directories in the SD Card and it has to be able to move through the different directories. I found a good tutorial in anddev. I modified a few things so the application moves in the SD Card and not in Android root Directories but the rest is mostly the same. This is my xml file for the activity: <?xml version="1.0" encoding="utf-8"?> <ListView xmlns:android="http://schemas.android.com/apk/res

Android 自定义Adapter实现多视图Item的ListView

◇◆丶佛笑我妖孽 提交于 2020-01-08 22:35:37
自定义Adapter实现多视图Item的ListView http://www.devdiv.com/adapter_item_listview-blog-20-7539.html 1、原理分析 Adapter对于ListView是非常重要的,它处于listView和数据源的中间,负责为ListView创建具体的视图。之前提到过ListView采用了View复用技术,即使需要显示大量的数据列表时它也能高效的工作,它总是试图复用已经存在的View。 下面就对View复用技术,做简单的讲解: 简单来说,假设一个ListView中存在7个Item,从上到下分别是Item1~Item7,当用户向上滑动屏幕时,Item1会滚动到屏幕区域以外,item1并没有被销毁,而是被放入了回收站(Recycler)。当ListView需要显示下一个item时,它会首先检查回收站里是否有可用的Item,刚好发现了item1,直接复用item1。ListView把获取到的Item1和新的位置(position8)传递给Adapter的getView方法,在getView方法中根据position8从数据源中取出对应的数据覆盖到item1,这时item1就变成了item8。最后,ListView把新生成item8显示到界面上。 而当ListView中存在不同视图的Item的时候,Adapter中存在一个int

android退出一个含有listview的activity时报java.lang.IllegalA

社会主义新天地 提交于 2020-01-08 11:50:15
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> @Override public void unregisterDataSetObserver(DataSetObserver observer) { if (observer != null) { super.unregisterDataSetObserver(observer); } } 原因是: I too was having the same problem and it seems that unregisterDataSetObserver on your DealPageAdapter is being called twice. To fix the problem I overwrote the unregisterDataSetObserver in my Adapter as such 看不懂没关系,总之是adapter的错。查看代码发现当请求到的listview的数据list为空时,依然设置了adapter,而且代码又被try catch包裹,所以没有报错。解决方法就是在设置adapter之前,判断提供数据的list是否为null,且其元素是否为0. 来源: oschina 链接: https://my.oschina.net/u/1014842/blog/337757

listview、ViewPager tips

て烟熏妆下的殇ゞ 提交于 2020-01-08 11:43:16
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1,listView的childView 与adapter 中数据项的对应关系 listView.getChildCount() 包含了headerView、footerView 以及 cellView, 而 Adapter 的 getItemCount() 只包含数据项(对应cellView 的个数), 所以如果有通过listview的childView 找对应的数据item的话,使用时需要注意计算 //在listview 的 adapter中 int cc = listView.getChildCount(); int headerCount = listView.getHeaderViewsCount(); //int footerCount = listView.getFooterViewsCount(); int itemCount = getCount(); for (int i = 0; i < cc; i++) { View child = listView.getChildAt(i); int tmp_pos = listView.getPositionForView(child); int position = tmp_pos - headerCount; if (position < 0

What is the best pattern to sync data between two recycler view with two activities?

假装没事ソ 提交于 2020-01-07 02:51:07
问题 I have two activities where they have almost same data, I am using same Adapter, But the problem is how to sync data. E.g. Activity A has recyclerview where it has like buttons in each row with unique id. Activity B also have same recyclerview but with some filter mechanism so it is not going to show all row, my question is how to handle like button state in Activity A and Activity B , such that if I click on activity B's like button than activity A's like button will automatically gets

How to set the click listener on a button generated by my adapter?

妖精的绣舞 提交于 2020-01-07 02:48:13
问题 This is my simple adapter: public class MainAdapter extends BaseAdapter { private Context mContext; private Integer[] mText = { R.string.main_team, R.string.main_league, R.string.main_economy, R.string.main_arena, R.string.main_staff, R.string.main_team_up }; public MainAdapter(Context c) { mContext = c; } @Override public int getCount() { return mText.length; } @Override public Object getItem(int arg0) { // TODO Auto-generated method stub return null; } @Override public long getItemId(int

Gallery Force Close using Fragment

久未见 提交于 2020-01-06 15:14:22
问题 I'm getting a Force Close when I launch the Gallery Fragment. It's not the code from the Gallery since Ranghunandan showed me what was wrong there. I think (but I'm not sure) it's within the ImageAdapter. I'll also post the LogCat Here's the Java Code import java.lang.ref.WeakReference; import android.app.Activity; import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.AsyncTask; import

OutOfMemoryError in my gridAdapter

…衆ロ難τιáo~ 提交于 2020-01-06 14:52:14
问题 I'm trying create adapter for my gridView which should contains photo, which I chose in gallery. But I have following OutOfMemoryError in line "return row" public class GridViewAdapter extends ArrayAdapter<String> { private Context context; private int layoutResourceId; private ArrayList<String> images_urls; public GridViewAdapter(Context context, int layoutResourceId, ArrayList<String> images_urls) { super(context, layoutResourceId, images_urls); this.layoutResourceId = layoutResourceId;