Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old December 2nd, 2011, 11:23 AM   #1 (permalink)
New Member
 
Join Date: Dec 2011
Posts: 1
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

lucassassa is offline  
Reply With Quote
Sponsors
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 11:51 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo