EditText in list view
Hi i have a EditText and Button in my listitem there are three items in my listview  my task is to show a toast when  some one click the button containing the text in the corresponding Edittext but it showing null on toast can any one please point where i am wrong. here is my code.

package org.ritesh;



    public class Edit_Text_listviewActivity extends Activity {
        /** Called when the activity is first created. */
    	ListView list;
    	List<String> hello;
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            list=new ListView(this);
            
            setContentView(list);
            hello=new ArrayList<String>();
            hello.add("Hello");
            hello.add("Hello World");
            hello.add("Hello world");
            
            adapter adap=new adapter(this,android.R.layout.simple_list_item_1,hello);
           list.setAdapter(adap); 
        }
        public class adapter extends ArrayAdapter
        {List<String> hello;
    Button btn;
    EditText text;
    		public adapter(Context context, int textViewResourceId, List<String> objects) {
    			super(context, textViewResourceId, objects);
    			// TODO Auto-generated constructor stub
    		hello=objects;
    		}
    		public int getCount(){
    			return hello.size();
    		}
        	
        	
        		@Override
        		public View getView(int position, View convertView, ViewGroup parent){
        		
        			LayoutInflater inflater = (LayoutInflater) Edit_Text_listviewActivity.this
        					.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        			View rowview=(View)inflater.inflate(R.layout.main, parent,false);
        			text=(EditText)rowview.findViewById(R.id.edit);
        			text.requestFocusFromTouch();
        			btn=(Button)rowview.findViewById(R.id.btn);
        			btn.setOnClickListener(new OnClickListener(){
    
    					@Override
    					public void onClick(View arg0) {
    						// TODO Auto-generated method stub
    						String str=text.getText().toString();
    						Toast.makeText(Edit_Text_listviewActivity.this, str, Toast.LENGTH_LONG).show();
    					}
        				
        			});
        		return rowview;
        	}
        }
    }
EditText in list view
===

Hi i have a EditText and Button in my listitem there are three items in my listview  my task is to show a toast when  some one click the button containing the text in the corresponding Edittext but it showing null on toast can any one please point where i am wrong. here is my code.

package org.ritesh;



    public class Edit_Text_listviewActivity extends Activity {
        /** Called when the activity is first created. */
    	ListView list;
    	List<String> hello;
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            list=new ListView(this);
            
            setContentView(list);
            hello=new ArrayList<String>();
            hello.add("Hello");
            hello.add("Hello World");
            hello.add("Hello world");
            
            adapter adap=new adapter(this,android.R.layout.simple_list_item_1,hello);
           list.setAdapter(adap); 
        }
        public class adapter extends ArrayAdapter
        {List<String> hello;
    Button btn;
    EditText text;
    		public adapter(Context context, int textViewResourceId, List<String> objects) {
    			super(context, textViewResourceId, objects);
    			// TODO Auto-generated constructor stub
    		hello=objects;
    		}
    		public int getCount(){
    			return hello.size();
    		}
        	
        	
        		@Override
        		public View getView(int position, View convertView, ViewGroup parent){
        		
        			LayoutInflater inflater = (LayoutInflater) Edit_Text_listviewActivity.this
        					.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        			View rowview=(View)inflater.inflate(R.layout.main, parent,false);
        			text=(EditText)rowview.findViewById(R.id.edit);
        			text.requestFocusFromTouch();
        			btn=(Button)rowview.findViewById(R.id.btn);
        			btn.setOnClickListener(new OnClickListener(){
    
    					@Override
    					public void onClick(View arg0) {
    						// TODO Auto-generated method stub
    						String str=text.getText().toString();
    						Toast.makeText(Edit_Text_listviewActivity.this, str, Toast.LENGTH_LONG).show();
    					}
        				
        			});
        		return rowview;
        	}
        }
    }