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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:37:37+00:00 2026-06-15T00:37:37+00:00

Hi i want to pass a string through two ativities I’ve been looking for

  • 0

Hi i want to pass a string through two ativities I’ve been looking for it in another answers and tried this one:

public class GlobalVars extends Activity {
private static String winename;

public static String getWineName(){
    return winename;
}
public static void setWineName(String s){
    winename=s;
}

}

And set the string in activity 1 as this:

EditText searchbox=(EditText) findViewById(R.id.buscarmainText);
String searchb=searchbox.getText().toString();
GlobalVars.setWineName(searchb);

But, when I call the getWineName method in activity 2 it seems that the string winename is empty, is called like this:

public String sbuscar=GlobalVars.getWineName();

Don’t know what am I doing wrong.

  • 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-15T00:37:38+00:00Added an answer on June 15, 2026 at 12:37 am

    Its better to pass string between activities with intents

    In your first activity class:

    Intent i = new Intent(this, activity2.class);
    i.putExtra("KEY",YourData);
    

    In next activity class

    Bundle extras = getIntent().getExtras();
    if(extras !=null) {
        String value = extras.getString("KEY");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to go through each character in a String and pass each character
I want a way to pass a string statement from one base class to
I want to pass the parameter that List.sortBy takes through to another function. My
I want to pass string as a parameter in with my jni. but when
I want to pass a string that contains few words to jQuery when click
i want to pass a string from an input box that after submition automatically
I have the following scenario where I want to pass in string and a
I want to pass '#' to the query string like ?page.aspx?someParam=1234#5 .
I want to pass sValue that contain non-English String .... $.post(ajax.php?module=test&action=updates&id=+id+&field=+field+&val=+sValue; ... Then $valUpdate
I want to pass an object (not just a string or integer) from a

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.