android-listview

Nothing getting displayed in singleitem view

北战南征 提交于 2020-01-16 20:10:11
问题 I am having an app that retrieves information from parse and display into a list view ,but when the app is run and the list view item is clicked it opens a new activity and display some images and text from parse.com but it shows nothing like the image below Here is my code main activity.java public class MainActivity extends Activity { ListView listview; List<ParseObject> ob; ProgressDialog mProgressDialog; FinalAdapter adapter; private List<CodeList> codelist = null; @Override protected

Programmatically set position in ListView without scrolling

本秂侑毒 提交于 2020-01-16 18:33:05
问题 This is for a tablet running Android 4.4.2. I have a ListView with hundreds of items in it and about 20 are visible at a time. The user doesn't want the animation of smooth scrolling. How do I programmatically set the displayed position in a Listview without using smoothScrollToPosition() ? I searched Stack Overflow and in Android ListView setSelection() does not seem to work they suggested this: mListView.clearFocus(); mListView.post(new Runnable() { @Override public void run() { mListView

CheckedTextView disappears when scroll in ListView

左心房为你撑大大i 提交于 2020-01-16 18:17:47
问题 I have custom ListView. I'm using array adapter to fill my ListViews rows. It worked perfectly. When I select the ListView row, my checkedtextview become visible. After scrolling my checked situation disapper. How can i remember my checks ? Thanks in helpings. Here my Adapter package test.cbsmobil.ibb; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget

android: how to retain clicked list item's pressed/selected state until pressing other items on list

元气小坏坏 提交于 2020-01-16 13:21:13
问题 I want my list items to retain its pressed/selected state until I press other items on list. While typing this, I thought that I want it to work like RadioButtons without the circle buttons. I have tried setting the the list item's selected/pressed state true, or setting its background color on onListItemClick but when I do this, my list items stay clicked even after clicking other items. How can I unset the background color of the previously clicked items in the list? Or there is a different

Android - ListView item style fails when scrolling

只谈情不闲聊 提交于 2020-01-16 12:08:08
问题 I have an issue with my ListView . I use them in several projects and the error occurs in every one of them. In one case every item has a unique image, in the other case some items contain bold text, some don't. When I scroll the images/bold texts are not in the right position and when I scroll quickly up and down again at some point (in case b ) nearl all items are bold. The only post I could find was this one but it didn't solve the issue. Here's my custom adapter: private class MyAdapter

NullPointerException at LazyAdapter

拜拜、爱过 提交于 2020-01-16 10:55:41
问题 I am trying to perform a search on LazyAdapter class by creating a custom Filter. But when I am trying to perform the search by using the TextWatcher, the application is forcing close. The code for the LazyAdapter class is as follows: package com.demo.directory; public class LazyAdapter extends BaseAdapter { private Activity activity; private ArrayList<HashMap<String, String>> data; private static LayoutInflater inflater = null; public ImageLoader imageLoader; public LazyAdapter(Activity a,

NullPointerException at LazyAdapter

最后都变了- 提交于 2020-01-16 10:54:07
问题 I am trying to perform a search on LazyAdapter class by creating a custom Filter. But when I am trying to perform the search by using the TextWatcher, the application is forcing close. The code for the LazyAdapter class is as follows: package com.demo.directory; public class LazyAdapter extends BaseAdapter { private Activity activity; private ArrayList<HashMap<String, String>> data; private static LayoutInflater inflater = null; public ImageLoader imageLoader; public LazyAdapter(Activity a,

Android - TextView's Weight Property in LinearLayout is being ignored when used as ListView row View

这一生的挚爱 提交于 2020-01-16 10:00:20
问题 I have a CustomListView, when I longClick on a row, the layout of that row changes to a different listRow Layout. So far, everything is working, however, the layout of the new view is compressed. Here are my xml files: search_result_layout.xml --> this is the original xml file used by the customListView Adapter. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/search_result_layout" android:layout_width="fill

onTouchListener in adapter ListView make onItemClickListener not running

﹥>﹥吖頭↗ 提交于 2020-01-16 05:01:04
问题 I creating custom adapter for my list view. In getView method, I set onTouchListener for LinearLayout in my custom adapter. For some reason, onItemClickListener in my listview can't run because of this. This is my code for my custom adapter TransactionAdapter method: public class TransactionAdapter extends BaseAdapter { private LayoutInflater inflater; private ArrayList<CTransaction> transactions; public TransactionAdapter(Context context, ArrayList<CTransaction> transactions){ inflater =

ListView Changes Data on Scroll

痴心易碎 提交于 2020-01-16 01:09:12
问题 I have a ListView that is correctly populated with an array on create, but when I scroll, the data changes and is all out of order. I don't know wether the problem is in my CustomListViewAdapter or in my DetailsPage. Here's the For Loop that I am using to generate the textViews : if (currentObject.setTime != null && currentObject.setName != null) { String[] temporaryNames = currentObject.setName; int totalNames = (currentObject.setTime.length / currentObject.setName.length); for (int i = 1; i