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 8758869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:39:36+00:00 2026-06-13T14:39:36+00:00

i am new to the android and so i was just trying to make

  • 0

i am new to the android and so i was just trying to make a simple application which takes an integer data,rather a mobile no. from one activity to the another (in both activities it is stored in the edittext). i used the following code in the sender activity-

done.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            Intent i=new Intent(ctx,MainActivity.class);
            i.putExtra("number", Long.parseLong(edittext.getText().toString()));
            ctx.startActivity(i);
        }
    });

following is the receiving code in the receiver activity–

num=getIntent().getIntExtra("number", set_default);
    accept(num);

protected void accept(long t) {
    // TODO Auto-generated method stub
    edittext=(EditText)findViewById(R.id.editText1);
    String a=(edittext.getText().toString()+t);
    clear(edittext);
    edittext.append(a);
}
private void clear(EditText edittext) {
    // TODO Auto-generated method stub
    edittext.setText("");

}

num is of type long.

the problem with the above code is that it is working correctly upto the 8 digits of numbers but not with 9 digit onwards.
previously i used int with num and int.parseInt with putExtra in sender activity,but changed to long after the problem, but it retains.

can anyone plz help me out with this??

  • 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-13T14:39:37+00:00Added an answer on June 13, 2026 at 2:39 pm

    You’re still using getIntExtra. Use getLongExtra.

    num=getIntent().getLongExtra("number", (long) set_default);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm new to android. I'm just trying to make one simple search functionality for
I'm new in all widget staff so I'm trying to make one simple that
I am new to Android and just started working with Android 4.0.3. which enables
I am trying to develop a simple map application, which will display a map
I'm trying to make a real simple app in which clicking a button has
I'm kinda new to android development, but i'm trying to make a xml parser.
I'm new to Android programming and trying to wrap my head around this just
I am trying to make an Android/ Java application that needs to connect to
I'm just trying to make sense of a basic Android navigation-related question, namely How
Im trying to make a simple app, I wanted to add a new Activity

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.