0

我希望当我单击edittext时它应该显示一个弹出窗口,其中有带有项目列表的单选按钮,当我选择一个项目时它应该在edittext中显示它。怎么做?我没有得到解决方案。请告诉任何人。

4

3 回答 3

0
    et1.addTextChangedListener(new TextWatcher() {
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        //  at this u use alert box with radio buttons 
            // TODO Auto-generated method stub
        }


      @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        //leave blank
            // TODO Auto-generated method stub
        }

        @Override
        public void afterTextChanged(Editable s) {
          //leave blank
            // TODO Auto-generated method stub
        }
    });
于 2013-02-18T13:09:15.837 回答
0

你也可以用这个

      disValEdit.setOnTouchListener(new OnTouchListener() {
            public boolean onTouch(View v, MotionEvent event) {
                if(event.getAction() == MotionEvent.ACTION_UP) {



                  } });
于 2013-02-18T13:12:35.120 回答
0

你可以尝试这样的事情:

textView.addTextChangedListener(new TextWatcher() {
  public void afterTextChanged(Editable s) {
  }

  public void onTextChanged(CharSequence s, int start, int before, int count) {
  }

  public void beforeTextChanged(CharSequence s, int start, int count, int after) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setAdapter(adapter, new DialogInterface.OnClickListener() {

      public void onClick(DialogInterface dialog, int which) {
          textView.setText(which);
      }
    });
    builder.show();
  }
});
于 2013-02-18T13:14:18.643 回答