here is a possible solution. in the getView method listView, do the following:
enter code here: public View getView(final int position, View convertView, ViewGroup parent) { // A ViewHolder keeps references to children views to avoid unneccessary calls // to findViewById() on each row. final ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.main, null); // Creates a ViewHolder and store references to the two children views // we want to bind data to. holder = new ViewHolder(); holder.subText = (TextView) convertView.findViewById(R.id.subTxt); convertView.setTag(holder); } else { // Get the ViewHolder back to get fast access to the TextView // and the ImageView. holder = (ViewHolder) convertView.getTag(); } //TEXT BOX position is 0 then if(position == 0) { ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); clipboard.setText(txtEdit.getText().toString()); } return convertView; }
user1087919
source share