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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:45:46+00:00 2026-05-26T22:45:46+00:00

I`m trying to parse an object from my my main activity to a new

  • 0

I`m trying to parse an object from my my main activity to a new activity that starts when the user clicks a button. I’ve seached the internet and found how to parse primative types and custom made classes that implements parceble or serilizable, but can’t find any information on how to transfeer a raw object.

I’ll write psuedo-code of what I`m trying to achive below:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    loadConnectInfo();
    View connectButton = findViewById(R.id.connectButton);
    connectButton.setOnClickListener(this);
}

public void onClick(View v) {
    switch (v.getId()) {
        case R.id.connectButton:
            Intent i = new Intent(this, NewClass.class);
            Socket s = connect();  // this is the object I want to parse to to "NewClass"
            startActivity( i);
            break;
    }
  • 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-26T22:45:46+00:00Added an answer on May 26, 2026 at 10:45 pm

    You can’t pass an object that is neither serializable nor parcelable between activities this way. What you probably want to do in this case is make your code that manages and interacts with the socket into a service and bind to that service in all the activities that need to use it.

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

Sidebar

Related Questions

I am having a problem in trying to pass a ArrayList Object from Activity
I’m trying to parse text from a file that comes in a pseudo XML
I have been trying to parse Java exceptions that appear in a log for
I'm trying to run a java class that reads off some values from a
I am trying to write a function that will take an xml object, an
I'm trying to parse a file from the web on Android using the DOM
So I am trying to get a custom object from core data by setting
I am trying to parse some unicode text from an excel2007 cell read by
I'm trying to parse JSON string using Boost Spirit store JSON object into recursive
I'm trying to parse an html output file from a program called mirdeep. I

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.