Page 1 of 1

5 6 03) The following piece of code is designed to show a toast with each Action Up event. But, it shows nothing. Find a

Posted: Sun May 15, 2022 1:28 pm
by answerhappygod
5 6 03 The Following Piece Of Code Is Designed To Show A Toast With Each Action Up Event But It Shows Nothing Find A 1
5 6 03 The Following Piece Of Code Is Designed To Show A Toast With Each Action Up Event But It Shows Nothing Find A 1 (42.67 KiB) Viewed 73 times
5 6 03) The following piece of code is designed to show a toast with each Action Up event. But, it shows nothing. Find and explain the problem, then fix it. (7m) 1view.setOnTouchListener(new view.OnTouchListener() { 2 @Override 3 public boolean onTouch(view v, MotionEvent event) { 4 boolean flag-true; int action - event.getActionMasked(); if(action -- MotionEvent.ACTION_DOWN) { // some code goes here flag-flag; 9 if (action -- MotionEvent.ACTION_UP){ Toast.makeText(self,"Action Up", Toast.LENGTH_SHORT).show(); flag flagi } return flag; 15 ) 16}); 10 11 12 13 14