Good evening, I'm developing a multi-button app, where you can drag a button and drop it to a certain place already defined in the application, and each button has to open another screen with a different animated image (GIF) that you have with the drag button, how to set the image for each button? And what do you call it? Below is the piece of code I'm having trouble with.
View.OnLongClickListener longClickListener = new View.OnLongClickListener () {
public boolean onLongClick(View v) {
ClipData data = ClipData.newPlainText("","");
View.DragShadowBuilder myShadowBuilder = new View.DragShadowBuilder(v);
v.startDrag(data, myShadowBuilder, v, 0);
return true;
}
};
View.OnDragListener dragListener = new View.OnDragListener() {
@Override
public boolean onDrag(View v, DragEvent event) {
int dragEvent = event.getAction();
switch (dragEvent){
case DragEvent.ACTION_DRAG_ENTERED:
break;
case DragEvent.ACTION_DRAG_EXITED:
break;
case DragEvent.ACTION_DROP:
final View view = (View) event.getLocalState();
if(view.getId() == R.id.btA){
Intent TelaBoca = new Intent(TelaAprendizagem.this, TelaFala.class);
startActivity(TelaBoca);
}
break;
}
return true;
}
};