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

  • Home
  • SEARCH
  • 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 6767169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:55:10+00:00 2026-05-26T14:55:10+00:00

My application starts from an Main activity and this main activity has its own

  • 0

My application starts from an Main activity and this main activity has its own onTouchListener which is in its own class and from this onTouchClass im calling an AlertDialog when the finger was removed from the screen and its working.. And from this AlertDialog i have an intent that starts activity two.

But i have two variables in the onTouch class that i will need in activity two, So i tried in my AlertDialog initiate the onTouch class and make a .putExtra for each of the variables i need.

Intent i = new Intent();
i.setClass(context, ActivityTwo.class);
i.putExtra("Value1", onTouchClass.integer1);
i.putExtra("Value2", onTouchClass.integer2);
Log.d("Info", "Value1: " + onTouchClass.integer1);
Log.d("Info", "Value2: " + onTouchClass.integer2);
context.startActivity(i);

I did logging here and its also 0,On the other side (The activity that gets started) i did this:

getValue1 = extras != null? extras.getInt("Value1"): -1;
getValue2 = extras != null? extras.getInt("value2"): -1;
Log.d("Info", "Value1: " + getValue1);
Log.d("Info", "Value2: " + getValue2);

Then im taking a look in LogCat for theese logs and it says: Value1: 0 and Value2: 0

And i know there should be a value cus in my onTouchClass i have this which checking if i have a value in it:

GeoPoint p = mapview.getProjection().fromPixels((int) e.getX(), (int) e.getY());
integer1 = p.getLatitudeE6();
integer2 = p.getLongitudeE6();
Log.d("Info", "Value1: " + integer1);
Log.d("Info", "Value2: " + integer2);

From theese logs in LogCat i do get a value.. But why isn’t it working to get this value into the other classes???

  • 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-05-26T14:55:10+00:00Added an answer on May 26, 2026 at 2:55 pm

    Try to pass the string value instead of onTouchClass.integer1 this integer value

    check what ever the value is store in onTouchClass.integer1.

    before pass to the intent print this value and check the log.

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

Sidebar

Related Questions

I have an existing iPhone application which starts from a UIViewController. What I want
I have a Activity called main. If I call Toast.makeText(this, Hello World from main,
My application is basically one Activity that I quit by calling this.finish(); System.exit(0); where
In my application I start a Register activity from the Main Activity with a
I am trying to write an application that starts off from a main menu
I have an app which has a main activity that calls other activities on
I'm writing an application that starts with a loading activity. In the loading activity
suppose that you have two activities A(which is the main activity) and B when
I have developed an application in which i have implemented ontouchlistener with which i
i'm tring to start a new activity from the main one but i'm getting

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.