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
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
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
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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!