Android : edit items of a list view with a popup
In my application i have a 开发者_StackOverflow中文版a listview which has a textview as row.
On clicking each row, i want a poup to come where i can edit text and i should be able to extract this edited value to update in my application data as well as to reflect new value in popup
thanks a lot for your help and time
I couldnt make it work with popup but tried alert box and was implementation became very easy.
here is the code for alert box: http://www.androidsnippets.com/prompt-user-input-with-an-alertdialog
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
final View popupView = inflater.inflate(R.layout.popup2, null);
final PopupWindow popup2 = new PopupWindow(popupView,
RadioGroup.LayoutParams.MATCH_PARENT,
RadioGroup.LayoutParams.MATCH_PARENT);
popup2.setFocusable(true);
popup2.showAtLocation(view, Gravity.CENTER, 0, 0);
}
精彩评论