android-listview

FastScrollBar go out of screen, when SectionIndexer implemented

。_饼干妹妹 提交于 2019-12-10 17:35:50
问题 I do ListView with custom adapter which implement SectionIndexer. When I type only minSdkVersion = 8 in Manifest file, all works fine. But if I add targetSdkVersion = 11 (or more) to Manifest, fast scrollbar starts roll out of screen when I scrolling the list, but there is not the end of the list. And one more moment: if I add targetSdkVersion = 11 to manifest and do list adapter without SectionIndexer implementing, scrollbar works fine too. But i need targetSdkVersion = 11 or more, and need

Android SearchView Filter for List View

浪尽此生 提交于 2019-12-10 17:32:06
问题 I have an Activity which has a Action Bar on the top with a Search View. Also i am using Custom List View and want to filter from the key words entered in the search view should be associated with a particular text view in the List View Item. 回答1: in your onQueryTextChange(String Text) method of Listener use: adapter.getFilter().filter(Text.toString()); and implement your filter in your BaseAdapter class. here is the sample code: @Override public Filter getFilter() { return filter; } private

ListView OnItemClickListener with a new activity

匆匆过客 提交于 2019-12-10 17:27:21
问题 I have a listView with an OnItemClickListener. When I am clicking on an item, I would like to open a new wiew in a new Activity like this: final ListView lv1 = (ListView) findViewById(R.id.ListView02); lv1.setAdapter(new SubmissionsListAdapter(this,searchResults)); lv1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { Intent myIntent = new Intent(v.getContext(), UserSubmissionLog.class); startActivityForResult

ListView layout_weight not working, height set to 0dp

ぐ巨炮叔叔 提交于 2019-12-10 17:16:40
问题 I'm trying to use the layout_weight attribute for testing. It works fine excpect for the ListView. I've set the height to 0dp and the weightsum. I've tried to put the ListView into a relative Layout but I get the same result. Here is my code: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:weightSum="1" > <TextView

How to update the listview when i click the button?

女生的网名这么多〃 提交于 2019-12-10 15:55:58
问题 public class MainActivity extends Activity { ListView list; String[] abc={"1","2","3"}; MyCustomAdapter adapter; Button refresh; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); list=(ListView) findViewById(R.id.list); refresh=(Button) findViewById(R.id.refresh); adapter=new MyCustomAdapter(MainActivity.this,abc); list.setAdapter(adapter); } private class MyCustomAdapter extends BaseAdapter { private final

Android: Listview's onItemClick() event not getting called

限于喜欢 提交于 2019-12-10 15:38:57
问题 Following is my code : public class TestActivity extends ListActivity { private Cursor cursor; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.test); fillData(); } @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); // Get the item that was clicked Object o = this.getListAdapter().getItem(position

Why does isItemChecked() return true when in ActionMode?

怎甘沉沦 提交于 2019-12-10 15:33:24
问题 I've set up an ActionMode callback for use as the contextual ActionBar (CAB) within an ActionBarSherlock using project. I'm trying to set up multiple select so that I can delete multiple items in a ListView . I noticed while debugging, when the contextual ActionBar (CAB) is not open and I call isItemChecked() on a list item that I touch, it returns false as it should. But when the CAB IS open, items that I touch (that I haven't touched before) return true on calls to isItemChecked() . Then

ActionBar-PullToRefresh with ListView and Fragment

你说的曾经没有我的故事 提交于 2019-12-10 15:20:24
问题 I am trying to implement ActionBar-PullToRefresh in my application. The activity has a fragment in it and the fragment has a listview in it. The implementation of listview is with custom adapter. I tried to implement it with the QuickStart-ABS guide on github, but the pull doesn't work. I have a feeling that I am not initialising the PullToRefresh correctly. Please have a look at my code below... fragment_news_list.xml <?xml version="1.0" encoding="utf-8"?> <uk.co.senab.actionbarpulltorefresh

Items in ListView not long clickable after setting click listener in getView()

自古美人都是妖i 提交于 2019-12-10 14:36:57
问题 I've searched around and have not come out with a solution (maybe not using the correct keywords). So, I've a custom ListView which its item can be dragged around when the item is long clicked. Within its item, there's an ImageView and LinearLayout containing two TextViews. Actions are done when the LinearLayout or ImageView is clicked. To do this, I've use setOnItemLongClickListener on my DragListView which extends ListView, to initiate drag action, and onInterceptTouchEvent to manage the

Android: HorizontalScrollView in a ListView row Item, focus issue

老子叫甜甜 提交于 2019-12-10 14:28:27
问题 I have a ListView that each item has a layout that contains a HorizontalScrollView . the problem is that I can't get the whole list item to be focused on when the user clicks or touches a list item. how can I solve this ? Thanks Edit: the HorizontalScrollView looks like this: <HorizontalScrollView android:layout_width="fill_parent" android:layout_height="wrap_content" android:fillViewport="true" android:scrollbars="none" android:focusable="false" android:fadingEdge="none" android:layout