adapter

RSS Feed and Google's XML Adapter example - Does it work?

▼魔方 西西 提交于 2019-12-13 13:24:22
问题 I'm trying to understand Google's example of XML Adapters as shown at http://developer.android.com/resources/samples/XmlAdapters/index.html, especially as it related to RSS feeds. I cannot get Google's sample code to compile. The Adapters.java code seems to have several issues with undefined variables, mContext , mFrom , and mTo as used in the XmlCursorAdapter class. I am new to Android and am trying to get this to work with a API level 4 program. Has anyone gotten this example to work? Can

show List of all contacts with phonenumber in android? [duplicate]

夙愿已清 提交于 2019-12-13 09:40:49
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to read contacts on Android 2.0 Is it possible to create a List of my all Contacts with PhoneNumber in phone book , but condition is if it don't have PhoneNumber then it shows only name for that record. I want all this in my android application.I have stuck with this. 回答1: By this way you found all contact name that have no contact number. while (cur.moveToNext()) { String id = cur.getString(cur

Call custom dialog in Adapter class

狂风中的少年 提交于 2019-12-13 09:06:02
问题 I have created a simple Custom dialog class and I want to display it after clicking on a row in RecycleView . My dialog class looks: public class AddToQueueDialog extends Dialog implements View.OnClickListener { Activity mActivity; private TextView textView1; private TextView textView2; private Button save; public AddToQueueDialog(Activity activity){ super(activity); mActivity = activity; } @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate

how to get position of arraylist in own adapter

孤人 提交于 2019-12-13 08:35:27
问题 I want to set the position of the arraylist (items) into my own adapter of listview. holder.txtViewTitle.setText(title.get(position)); But I got the error. Please check the below code. also I got the error of the setImageResource. holder.imgViewLogo.setImageResource(images[position]); Thanks. public class LazyAdapter extends BaseAdapter{ private activites context; private ArrayList<String> title; private String[] images; private LayoutInflater inflater; public LazyAdapter(activites activites

Cannot cast onItem clicklistener inside Fragment Class form Adapter Class

左心房为你撑大大i 提交于 2019-12-13 08:03:12
问题 I have an Fragment with recycleview where I populate it with json items from internet. It load fine and Next step I want to is open new Activity when any row is clicked. It works in activity, thus I modified the same code for fragment but for fragment it throws exception in line mExampleAdapter.setOnItemClickListener(getActivity()); with errror setOnItemClickListener of refrence adatper cannot be applied to Fragment activty and thus when I change line to (ExampleAdapter.OnItemClickListener)

Changing gridVIew's imageView outside of the adapter

强颜欢笑 提交于 2019-12-13 07:37:32
问题 How can I do it? This is the method in GridView adapter public static void changeView(Bitmap bmp, int pos){ GridView gridView = new GridView(mContext); ImageView view = (ImageView) gridView.getChildAt(pos); if (view == null) Log.e("ImageAdapter Error", "ImageView is null"); } This is a getView method @Override public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { // imageView = Inflater.inflate(R.layout.image_layout, null);

notifyDataSetChanged not working while retrieving SQLite Data

核能气质少年 提交于 2019-12-13 06:33:02
问题 Declaring private List<SQLiteHelper> messages = new ArrayList<>(); privare MessagesAdapter mAdapter; private RecyclerView messageList; Initialising messageList = (RecyclerView) findViewById(R.id.message_list); messageList.setHasFixedSize(true); messageList.setLayoutManager(linearLayoutManager); mAdapter = new MessagesAdapter(messages); messageList.setAdapter(mAdapter); mAdapter.notifyDataSetChanged(); Fetching while (csr.moveToNext()) { String mSender = csr.getString(csr.getColumnIndex(KEY

ListView with customAdapter not updated when notifyDataSetChanged is called?

倖福魔咒の 提交于 2019-12-13 05:56:20
问题 I have a Listview with two adapters. They receive an Array with some data and when scrolled to bottom of the listview more data is loaded into the Array and here the listview should add the new data. Question: How can I make the listview reflect the new data and why isn't it updated when I call adAdapter.notifyDataSetChanged(); ? Fragments inner class where I download data & update UI in onPostExecute: @Override protected void onPostExecute(String result) { super.onPostExecute(result);

Listview only displaying last item of arraylist

北城以北 提交于 2019-12-13 05:44:15
问题 I have a problem. Currently i'm using Lazyloading to load images and data into my listview using arraylist. However it only display the last item of the arraylist. Below is the LazyLoading adapter class: public class LazyAdapter extends BaseAdapter { private Activity activity; private ArrayList<Hashtable<String,String>> data; private static LayoutInflater inflater=null; public ImageLoader imageLoader; public LazyAdapter(Activity a, ArrayList<Hashtable<String,String>> d) { activity = a; data=d

The Network Adapter could not establish the connection网络适配器无法连接

落花浮王杯 提交于 2019-12-13 05:05:13
The Network Adapter could not establish the connection。网络适配器无法连接 启动项目时,oracle连接报错 几个错误原因和解决办法: 1、IP错误:数据源配置时数据库服务器的ip或者端口号填写错误。 数据库服务器是否正确:ping 服务器IP是否通畅。ping不通则将URL更改正确。 端口号是否正确。 进行一下操作:在DOS上键入sqlplus,检查oracle是否开启 一切正常则执行下面第2步。 2、防火墙 如果机器上安装有放火墙,可能是服务器端口号屏蔽而造成的。关闭防火墙后,尝试重新连接。 你的防火墙可能开启,然后不允许你的端口号通过,所以你选择关闭防火墙或者开启你的端口。windows开启端口有点麻烦。所以建议关闭防火墙尝试。 Linux查询端口号是否开启的指令:firewall-cmd --query-port=端口号/tcp Linux开启端口号指令:firewall-cmd --add-port=端口号/tcp 仍然不行则执行第3步。 3、数据库监听器未启动 修改PC上注册表中的ImagePath值。 下面以ORACLE数据库为例 重新手动启动数据库监听: 1:开始 → 运行→ 输入CMD→ 进入DOS命令提示界面 d:>lsnrctl LSNRCTL> status 或者 LSNRCTL> start