Wrox Programmer Forums
|
BOOK: Beginning Android Application Development
This is the forum to discuss the Wrox book Beginning Android Application Development by Wei-Meng Lee; ISBN: 978-1-1180-1711-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Android Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 27th, 2011, 12:06 PM
Registered User
 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 4 - Filtered multi-select listview

I was running the example on page 159 (Customizing the List View). I understand how the list is filtered by using the setTextFilterEnabled method. But when the list is filtered and you select one of the items, the wrong president's name is displayed. It looks like it is returning the name of the president in the location of the original non-filtered list.

Any way to use the filtered list instead?
 
Old November 27th, 2011, 12:15 PM
Registered User
 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found one solution. I don't know if its the correct one, but it works. I am posting it for anyone that encounters the same issue. I modified the onListItemClick event.

Code:
        final ListAdapter listAdapter = getListAdapter();
    	
        Toast.makeText(this, 
    	    "You have selected " + listAdapter.getItem(position).toString(), 
            Toast.LENGTH_SHORT).show();
 
Old December 1st, 2011, 09:52 PM
Authorized User
 
Join Date: Nov 2011
Posts: 86
Thanks: 3
Thanked 5 Times in 5 Posts
Default Still the list is wrong.

Hi All
Well that gives you the right name in the message, the wrong name is selected in the list. If you type "O" and select Obama, then dismiss the filter (ESC). You will see Eisenhower's name checked and not Obama's. The filter is neat, but if it gets you the wrong data, what good is it?

Did any one try 'simple_list_item_2' and get it to work?

Cliff
__________________
"Software to the Stars"
Failure is not an option. It comes bundled with your Microsoft products.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate ListView From ComboBox Select eusanpe C# 4 August 20th, 2007 06:49 PM
Multi-Select Parameters jparkgb BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 0 August 14th, 2006 06:02 AM
Filtered Sharepoint list, not filtered in infopath wmrdude SharePoint Development 0 July 26th, 2006 05:09 AM
how to select an item from listview jthadathilm16 VB How-To 1 April 24th, 2006 11:33 AM
Multi Select Combo Box acdsky VB How-To 2 March 1st, 2004 03:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.