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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:02:41+00:00 2026-06-04T14:02:41+00:00

I have a question about intent in android application i have an array in

  • 0

I have a question about intent in android application

i have an array in class1

double [][] tableCityPair = new double[100][100];

—here code to fill array—
in the end of class i want to send tableCityPair to another class, class2.

how i should declare for array in class2 ?
is this right?

Intent it = getIntent();
double tabelJarakAntarKota= it.getDoubleExtra("tableCityPair",3);
  • 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-04T14:02:42+00:00Added an answer on June 4, 2026 at 2:02 pm

    The Bundle class has methods for passing and retrieving an array of doubles:

    • void putDoubleArray(String, double[])
    • double [] getDoubleArray(String)

    However, these work for one-dimensional arrays. You are attempting to pass a 2D array. I do not know of a direct way to do this. One way to achieve this would be to put N arrays of doubles in a loop.

    for(int i=0;i<tableCityPair.length;i++){
        bundle.put("tableCity"+i, tableCityPair[i]);
    }
    

    And at the receiving end, you do:

    double [] aPair = it.getExtras().getDoubleArray("tableCity"+i);
    

    I’m not sure about the performance implications of this though; since you would be adding 100 extras as part of the bundle.

    There could be a better way (perhaps make your pair a List<List<Double>> and then implement Parcelable) but I haven’t tried any of it so I wouldn’t suggest it.

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

Sidebar

Related Questions

simple question about intent action naming convention: I have a new service that handles
I have a question about the Android Facebook API singleSignOn() method. The code below
I'm pretty new to Android development, and I have a quick question about a
I have a question about communication between activities on implementation program of Android. Here
I have a question about parcelable class (android). Until now, I have passed a
I have seen numerous answers on here about creating an intent filter for a
Good Morning. I have a question about how to create an application without GUI.
Simple question (I guess). I have this default google tutorial code for tabs: intent
I have a question about transferring data through Intent() to a MapView. String coorx
I have a question about how to send email in android. My app creates

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.