how can i do search in listview when i am using simple adapter for listview
<p>making search bar in listview when i used simple adapter.I am using the below code.while executing this code it is showing null pointer exception. can any one helps me. Thanks in advance.</p>

<pre><code>String headlines1[]={"Dell Inspiron", "HTC One X", "HTC Wildfire S", "HTC Sense", "HTC Sensation XE","iPhone 4S", "Samsung Galaxy Note 800","Samsung Galaxy S3", "MacBook Air", "Mac Mini", "MacBook Pro"};
for (int j = 0; j &lt; headlines1.length; j++)

            {

                HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
                map.put("row1", ":"+headlines1[j]);



                mylistData.add(map);

            }
        SimpleAdapter    arrayAdapter =

            new SimpleAdapter(this, mylistData, R.layout.simple_list_item_2,

            row, new int[] { R.id.tv});
            lst.setAdapter(arrayAdapter);

             lst.setTextFilterEnabled(true);

             inputsearch.addTextChangedListener(new TextWatcher()
            {


                @Override
                public void onTextChanged( CharSequence cs, int arg1, int arg2, int arg3)
                {
                    // TODO Auto-generated method stub
                     String searchString=inputsearch.getText().toString();
                       int textLength=searchString.length();

                              //clear the initial data set
                       searchResults.clear();

                       for(int i=0;i&lt;mylistData.size();i++)
                       {
                      String playerName=mylistData.get(i).get("row1").toString();
                      if(textLength&lt;=playerName.length()){
                      //compare the String in EditText with Names in the ArrayList
                        if(searchString.equalsIgnoreCase(playerName.substring(0,textLength)))
                        searchResults.add(mylistData.get(i));
                      }
                       }

                       arrayAdapter.notifyDataSetChanged();
                }
</code></pre>
