ListView with TextFilter

by vincent.gann...@gmail.com » Fri, 06 Mar 2009 22:00:30 GMT


Sponsored Links
 Hi all,

I have a ListView with the text filter enabled plus an
OnItemClickListener. I don't understand how to find out which item
from my initial list was clicked because in void onItemClick
(AdapterView <?> parent, View v, int position, long id) position gives
the current position of the clicked item (after filtering) which is
NOT the initial position of this item in the list.

Any way to do it? I would be disapointed if we should do the filtering
ourselves in the same time in the corresponding ListAdapter...

Thanks.
--~--~---------~--~----~------------~-------~--~----~



ListView with TextFilter

by Romain Guy » Sat, 07 Mar 2009 00:44:33 GMT


 Filtering happens in the adapter at the same time. All you have to do
is use the position parameter to ask the adapter for the item at that
position.

On Fri, Mar 6, 2009 at 6:00 AM, vincent.gann...@gmail.com





-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


ListView with TextFilter

by vincent.gann...@gmail.com » Sat, 07 Mar 2009 00:54:32 GMT


 It works! Great! Thanks Romain :-)
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Finding Location Latitude and Longitude using GPS in HTC MAGIC device..



You have not requested location updates, so getLastKnownLocation() will
always return null.

Also, getLastKnownLocation() will almost never have a value immediately,
as it takes GPS some time to obtain a fix.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Consulting/App Development: http://commonsware.com/consulting

2. Finding Location Latitude and Longitude using GPS in HTC MAGIC device..

Hi all,
I have the problem like this.
Basically i want to find my present location's latitude and
longitude .It is showing in emulator which is default one which points
to Sanjose,usa.But it is not finding my current location(i am in
Hyderabad,India).When i try to run the same application in My HTC
magic (Android os 1.5) it is showing NULL.It is Not finding my present
location.
What i have to do..is there need of Network provider like Mobile
network(Vodafone,airtel etc..)
I am sending my code,Please check it and send me the working code if
any body have,Please i need it urgently.
Please Help me regarding this.
Thanks,
Ram.P
the code is as follows:
------------------------------------------------------------------------
class WhereAmI extends Activity {

  @Override
  public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.main);

    LocationManager locationManager;
    locationManager = (LocationManager)getSystemService
(Context.LOCATION_SERVICE);
    Location location = locationManager.getLastKnownLocation
(LocationManager.GPS_PROVIDER);

    updateWithNewLocation(location);
  }

  /** Update UI with a new location */
  private void updateWithNewLocation(Location location) {
          TextView myLocationText = (TextView)findViewById
(R.id.myLocationText);

          String latLongString;

    if (location != null) {
            double lat = location.getLatitude();
            double lng = location.getLongitude();
            latLongString = "Lat:" + lat + "\nLong:" + lng;
          } else {
            latLongString = "No location found";
          }

          myLocationText.setText("Your Current Position is:\n" +
latLongString);
        }

}
-----------------------------------------
Manifest file is as follows:

----------------
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.paad.whereami">
  <application android:icon="@drawable/icon">
    <activity android:name=".GPS" android:label="@string/app_name">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
  </application>
  <uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>
</manifest>

--------------------------------------

Please help me very urgently.......

3. Finding direction using compass

4. 2010 : Android Army is coming..choose ur soldier!!

5. App crashes on Droid, works fine on G1

6. Flowing View Group

7. applying style to textview