Fwd: Filter for Custom ListView

by pawan nimje » Wed, 21 Apr 2010 18:14:48 GMT


Sponsored Links
 i,

I am having a custom listview [list with image and 2 textbox] and i
want to apply filter for it.

desc of cust listview:

1:Image i.e flag of country

2:1st textbox (name of country)

3:2nd textbox (name of continent)

so when i write " i " in a textbox [different from the ones mentioned
above] i want the list to get filtered according to country name.

My code details:

1:_________________________row.xml [each row of
list]__________________________

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="6dip"/>
<!-- android:src="@drawable/icon" />-->
<LinearLayout
android:orientation="vertical"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="35dip">
<TextView
android:id="@+id/toptext"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:gravity="center_vertical"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:id="@+id/bottomtext"
android:singleLine="true"
android:ellipsize="marquee"
/>
</LinearLayout>
</LinearLayout>

2:__________________main.xml_____________________

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<EditText android:id="@+id/search_box"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="type to filter"
android:inputType="text"
android:maxLines="1"/>
<ListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<TextView
android:id="@+id/android:empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/main_no_items"/>
</LinearLayout>

3:_______________________softwarepassionview.java___________________________
package com.softberries.lve;

import java.util.ArrayList;

//import com.TryFilter.R;

import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import a



Other Threads

1. disable the search key android alertdialog

Hi,
Anyone know of a way to prevent the search key from canceling an alert
dialog? I have alert.setCancelable(false); and it works fine for the
back button, but when i hit the search key it goes to search.. and
when I close the search my NON-Cancelable dialog is gone. any way to
fix this. Please help

-- 

2. Sipdroid build problem

Hello I am trying to build sipdroid under eclipse,I have downloaded
the source from the svn found on the site and I followed the
instructions found on the build.txt file.
In the second step saying to execute ant debug the ant script fails
this is the output of the console:
[max...@localhost sipdroid-read-only]$ ant debug
Buildfile: build.xml
    [setup] Android SDK Tools Revision 6
    [setup] Project Target: Google APIs
    [setup] Vendor: Google Inc.
    [setup] Platform Version: 1.5
    [setup] API level: 3
    [setup] Importing rules file: platforms/android-3/ant/
ant_rules_r2.xml

-compile-tested-if-test:

-dirs:
     [echo] Creating output directories if needed...

-resource-src:
     [echo] Generating R.java / Manifest.java from the resources...
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:26: error: No resource identifier found for
attribute 'installLocation' in package 'android'
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:31: error: No resource identifier found for
attribute 'targetSdkVersion' in package 'android'
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:32: error: No resource identifier found for
attribute 'normalScreens' in package 'android'
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:32: error: No resource identifier found for
attribute 'smallScreens' in package 'android'
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:32: error: No resource identifier found for
attribute 'largeScreens' in package 'android'
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:32: error: No resource identifier found for
attribute 'anyDensity' in package 'android'
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:37: error: No resource identifier found for
attribute 'required' in package 'android'
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:38: error: No resource identifier found for
attribute 'required' in package 'android'
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:39: error: No resource identifier found for
attribute 'required' in package 'android'
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:40: error: No resource identifier found for
attribute 'required' in package 'android'
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:41: error: No resource identifier found for
attribute 'required' in package 'android'
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:42: error: No resource identifier found for
attribute 'required' in package 'android'
     [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-
read-
only/AndroidManifest.xml:43: error: No resource identifier found for
attribute 'required' in package 'android'

BUILD FAILED
/home/maxsap/Documents/progrs/android/android-sdk-linux_86/platforms/
android-3/ant/ant_rules_r2.xml:220: null returned: 1

note that when I do ant, the script successfully  completes.
but then when I import the project in eclipse doing file->import-

The project contains errors (seems like the R.java class isn't
present) and also there are errors in the Android manifest xml file
saying that some attributes in the xml are wrong but they aren't e.g
says that android:targetSdkVersion attribute is wrong.I have posted
this question on the official groups but no luck so far, this is the
original post 

3. Localization in Android for Indian Languages

4. Exerciser Monkey and media volume

5. Why on earth do the Android Ant tools use javac with encoding="ascii"?

6. wrong soap response it is in String except XML

7. Sending big binary sms