I want to open a Custom Dialog() when my Custom list view item is clicked.
I tried so far but can’t open the dialog. Here is code details:
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);
Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.input_dialog);
dialog.setTitle("What about Today!");
**//initialize custom dialog items.**
EditText mood = (EditText) dialog.findViewById(R.id.editTextyourMode);
Button btnSaveButton = (Button) dialog
.findViewById(R.id.btnSaveMyMoods);
Button btnClear = (Button) dialog
.findViewById(R.id.btnClear);
dialog.show();
}
here is custom Array adapter getView(…) method.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(R.layout.sell_info_list, parent, false);
TextView product_id = (TextView) rowView.findViewById(R.id.product_id);//
product_id.setText(products.get(position).getProduct_id());
EditText product_quantity = (EditText) rowView
.findViewById(R.id.editTextQuantity);
return rowView;
}
Finally,I want to open this dialog whenList view item edit text is clicked.
Anyone help me?
i open the dialog typing from these inside getView(…) in Adapter and also can showing on the selected listview item EditText.
Then the Screen look like that.

Now facing a problem.My List View has just 10 items.When i scrolling the list view,the item text vanish which is unseen
Thanks every one for sharing knowledge.**