I Have eight View flipper which have 4 Question and 4 Answers. Which is display those Question and Answers, whenever that particular viewflipper is clicked. My problem is, When first time any viewflipper is clicked, at that time nothing to do, and after on viewflipper is clicked the next clicked viewflipper value want to check which is same(equal) or not.(If Question is 5+3 then answers should be 8).
Condition:
if I am first time Q is clicked then next time another viewflipper which have Q is clicked nothing check operation is necessary and nothing hide .
if I am first time Q is clicked then next time A is clicked retrive value from textview of Q and check is it right or not, if it is right hide both Q and A.
if I am first time A is clicked then next timeQ is clicked retrive value from textview of A and check is it right or not, if it is right hide both Q and A.
if I am first time A is clicked then next time another viewflipper which haveA is clicked nothing check operation is necessary nothing hide.
if I am first time Q is clicked then next time same viewflipper which have Q is clicked nothing check operation is necessary nothing hide.
if I am first time A is clicked then next time same viewflipper which have A is clicked nothing check operation is necessary nothing hide.
So, How to check Current clickable ViewFlipper and Previous clicked ViewFlipper. I did not get any idea how to check the problem.
Look at this, I think, my problem is more clear.
Edited: Dec 16
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.vf1:
try {
if (click) {
Message msg = new Message();
msg.what = 1;
delayHandler.sendMessageDelayed(msg, DELAYTIME);
vFilpper1.showNext();
} catch (Exception e) {
e.printStackTrace();
}
counter++;
break;
case R.id.vf2:
try {
Message msg = new Message();
msg.what = 2;
delayHandler.sendMessageDelayed(msg, DELAYTIME);
Log.d("viewfilpper", "VFlipper 2");
vFilpper2.showNext();
} catch (Exception e) {
e.printStackTrace();
}
break;
case R.id.vf3:
try {
Message msg = new Message();
msg.what = 3;
delayHandler.sendMessageDelayed(msg, DELAYTIME);
Log.d("viewfilpper", "VFlipper 3");
vFilpper3.showNext();
} catch (Exception e) {
e.printStackTrace();
}
break;
case R.id.vf4:
try {
Message msg = new Message();
msg.what = 4;
delayHandler.sendMessageDelayed(msg, DELAYTIME);
Log.d("viewfilpper", "VFlipper 4");
vFilpper4.showNext();
} catch (Exception e) {
e.printStackTrace();
}
break;
case R.id.vf5:
try {
Message msg = new Message();
msg.what = 5;
delayHandler.sendMessageDelayed(msg, DELAYTIME);
Log.d("viewfilpper", "VFlipper 5");
vFilpper5.showNext();
} catch (Exception e) {
e.printStackTrace();
}
break;
case R.id.vf7:
try {
Message msg = new Message();
msg.what = 7;
delayHandler.sendMessageDelayed(msg, DELAYTIME);
Log.d("viewfilpper", "VFlipper 7");
vFilpper7.showNext();
} catch (Exception e) {
e.printStackTrace();
}
break;
case R.id.vf8:
try {
Message msg = new Message();
msg.what = 8;
delayHandler.sendMessageDelayed(msg, DELAYTIME);
Log.d("viewfilpper", "VFlipper 8");
vFilpper8.showNext();
} catch (Exception e) {
e.printStackTrace();
}
break;
See Question&Answers more detail:os