Skip to content Skip to sidebar Skip to footer

Create Edittext By Drag Drop Android Issue

I have three layouts: top, left and right. On top layout, I have EditText icon, when I drag it to left layout, will create an EditText in left layout. With EditText drop in left l

Solution 1:

Instead of moving the EditText, you should make a copy of it in the view. For example, you should do the following:

StringeditTextString= editText.getText().toString();
EditTextnewEditText=newEditText(MainActivity.this);
newEditText.setText(editTextString);

So, you need to copy the text from the EditText and create a new EditText which you will add to the container. Make sure that you don't make the view invisible when you call v.startDrag(data, shadowBuilder, v, 0);

Post a Comment for "Create Edittext By Drag Drop Android Issue"