Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9142163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:44:29+00:00 2026-06-17T09:44:29+00:00

By using Gestures, can i able to drag like this image ? I mean,

  • 0

By using Gestures, can i able to drag like this image ? I mean, have to drag as a tick mark . So for this onClickListener must be used. After it performs,then it should be able to open another screen finally in a display part.

When i use my hand, i mean if i put tick mark , then it should be able to call the particular method.

I wanna write a code by using Gestures and it should be able to perform or drag when i do like this below Image. How does functionalities works here in Gestures and how should i write the code?

How could i do this ? Could anyone suggest me ?See this "Tick" image

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:44:29+00:00Added an answer on June 17, 2026 at 9:44 am

    I believe you’re asking for something along the lines of this question. Here’s the source code that was provided by prateek-raj. Incidentally, while the sample checkmark image you provided is lovely, Android doesn’t care if your image is an image of a ball, a checkmark, or a squirrel holding a bazooka, so the below code is still applicable.

    package com.examples.Touchmoveimage;
    
    import android.app.Activity;
    import android.os.Bundle;
    import android.view.MotionEvent;
    import android.view.View;
    import android.widget.ImageView;
    import android.widget.LinearLayout.LayoutParams;
    
    public class Touchmoveimage extends Activity {
    
        int windowwidth;
        int windowheight;
    
        private LayoutParams layoutParams ;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
        windowwidth = getWindowManager().getDefaultDisplay().getWidth();
        windowheight = getWindowManager().getDefaultDisplay().getHeight();
        final ImageView balls = (ImageView)findViewById(R.id.ball);
    
        balls.setOnTouchListener(new View.OnTouchListener() {
    
                        @Override
                        public boolean onTouch(View v, MotionEvent event) {
                            LayoutParams layoutParams = (LayoutParams) balls.getLayoutParams();
                            switch(event.getAction())
                            {
                            case MotionEvent.ACTION_DOWN:   
                                                            break;
                            case MotionEvent.ACTION_MOVE:
                                                            int x_cord = (int)event.getRawX();
                                                            int y_cord = (int)event.getRawY();
    
                                                            if(x_cord>windowwidth){x_cord=windowwidth;}
                                                            if(y_cord>windowheight){y_cord=windowheight;}
    
                                                            layoutParams.leftMargin = x_cord -25;
                                                            layoutParams.topMargin = y_cord - 75;
    
                                                            balls.setLayoutParams(layoutParams);
                                                            break;
                            default:
                                                            break;
                            }
                                return true;
                        }
                });
    }
    }
    

    That addresses most of your question, but not quite all of it. You also asked,

    After it performs, then it should be able to open another screen
    finally in a display part.

    The answer is going to likely involve creating an Intent object (with the new activity defined in the constructor and starting it. There’s a good tutorial on the subject here. The heart of it (switching activities) is going to be something like this:

    Intent k = new Intent("com.example.ActivityYouWantToGoTo");
    startActivity(k);
    

    You’ll need to go through all the steps associated with creating a new activity. (E.g., don’t forget to update the manifest.) To make your code do both (a) dragging the checkbox and (b) switching to the new activity, you’ll need to combine the above concepts. You didn’t tell us under what circumstances you want the object dragged or the activity switched (e.g., after it’s dragged once? When it’s dragged to a specific location? etc.), but you’re going to want to define those conditions and then call the new activity when they’re met.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I must rotate an image but I can't use the gestures or the slider,
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Im looking for a nice demo/sample using Windows Mobile Managed Gestures. I have a
I need to create jQuery mobile like Swipe gestures $(#slider ul li div).swipeleft(); using
I am currently able to make an image scale by using the pinch gesture
I have already selected an image from SD card in my activity's ImageView using
I have a CCSprite that I want to move around using gestures. Problem is
I've an app which like the image shown below (sorry I used an iPhone
I need to catch two different swipping gestures using UISwipeGestureRecognizer (for example, UISwipeGestureRecognizerDirectionRight and
I want to know that is there any standards for defining gestures using Kinect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.