Filter for Custom ListView

by pawan nimje » Wed, 21 Apr 2010 05:05:25 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;



Other Threads

1. weird button behavior in emulator

I have an interface that handles dpad key events and has Buttons for
similar actions - my intention was to have code that works for
touchscreens and phones with dpads.

When testing, both the 5 on my number pad and using the mouse to click
the emulator's center dpad button presses a Button I have in my app,
which interferes with the button handling. Is there a way to disable
this so my coded Button does not get pressed?

For those interested, here (http://code.google.com/android/reference/
emulator.html#controlling) is a table that shows how keyboard keys
affect the emulator.


I have a related question - again, I'm trying to replicate the dpad
keys onscreen for those w/o a dpad, but with the dpad I can handle
both the key down and key up events. Is there an "up" event for Button
presses, or some trick for capturing when this happens? I would like
to perform an action when the user releases the onscreen Button.



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

2. How to trust an Intent sender?

Greetings to everyone,
I am extending the platform for another kind of hardware where it is
assumed that applications can take actions that may be dangerous.
Therefore it is essential that only applications verified by the
manufacturer can perform dangerous operations. For all other
applications will remain the original policies of Android. It is not
my intention devalues the openess of Android, but safety, in my case,
is of vital importance.

For reasons of modularity and adherence to the original architecture,
requests that applications make to my hardware are injected into the
system as Intent (...).

Supposing that Intents that request dangerous actions are handled by a
specialized "content provider"
My question is if there is a way (using only what's provided by the
framework of SDK1.0):
* to ensure that only trusted applications can deliver particular
types of Intent (...)?
or
* to verify (for example by the specialized "content provider" as
above) that the origin of Intent is a trusted application (through the
signature of the package, for example, etc)?

Thanks to all who want to attend their time,
see you soon

Filippo P.
--~--~---------~--~----~------------~-------~--~----~

3. Difference between Emulator and Realphone

4. encryption software

5. Missing Import "android.provider.Telephony"

6. How to monitor android application memory

7. Do you know which automation tools can be used on Android?