2
I’m having a problem with a list where I use a RecyclerView
, by clicking on an item in the list, OnClickListener
is dealt with in the ViewHolder
that RecyclerView
:
Meuviewholder:
public ClientesViewHolder(Context ctx, View itemView, Activity act) {
super(itemView);
itemView.setOnClickListener(this);
}
@Override
public void onClick(View v) {
Intent it = new Intent(ctx, TelaDadosClientes.class);
Bundle animacao = ActivityOptionsCompat.makeCustomAnimation(ctx, R.anim.slide_in_left, R.anim.slide_out_left).toBundle();
ActivityCompat.startActivity(activity, it, animacao);
}
Clicking on an item in the list opens a new activity
with an animation (which is not the case).
My problem is that if I double-click a list item it opens twice the same activity
. Can I disable this double touch (something like Ondoubleclicklistener Return false)?
OBS: In case you don’t understand comment I will give more details if necessary.
I do not know your procedure, but to prevent an Activity open again on the screen I use
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
I hope it helps– Armando Marques Sobrinho
Hello @Armando didn’t work, keep opening two activitys if I double click on an item.
– Bruno Romualdo
And
FLAG_ACTIVITY_CLEAR_TOP
?– Pablo Almeida