• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Open image in ListView

Good afternoon,
one would like to help if possible,
I have a listview with filter search

Code:
package de.vogella.android.list.filter;
 
import java.util.ArrayList;
import java.util.List;
 
import android.app.ListActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.ArrayAdapter;
import android.widget.EditText;
 
public class ListFilterDemoActivity extends ListActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1, android.R.id.text1,
                getModel());
        setListAdapter(adapter);
        EditText filterEditText = (EditText) findViewById(R.id.filterText);
        filterEditText.addTextChangedListener(new TextWatcher() {
 
            @Override
            public void onTextChanged(CharSequence s, int start, int before,
                    int count) {
                adapter.getFilter().filter(s.toString());
            }
 
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count,
                    int after) {
            }
 
            @Override
            public void afterTextChanged(Editable s) {
            }
        });
    }
 
    private List<String> getModel() {
        List<String> list = new ArrayList<String>();
        list.add("Text Image 01");
        list.add("Text Image 02");
        list.add("Text Image 03");
        list.add("Text Image 04");
        list.add("Text Image 05");
        list.add("Text Image 06");
        list.add("Text Image 07");
        list.add("Text Image 08");
        list.add("Text Image 09");
        list.add("Text Image 10");
        return list;
    }
}
I would like to insert icons in the list, different in each row
and also open images by clicking on each line.
would be possible?

Thank you for your attention and help.
 
Back
Top Bottom