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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:05:16+00:00 2026-06-06T01:05:16+00:00

I am newbie in android, in my android app, a main Activity class, which

  • 0

I am newbie in android, in my android app, a main Activity class, which contains a TextView for displaying various status message from other classes. I want to update TextView of main Activity with status values from other classes. There is no direct connection between main activity class and other class. Is it possible in android ? if yes i am not aware to do it. Kindly provide solution to do it

code snippets

//main activity
public class MainMenu extends Activity {

    static String status = "Hello Friends";

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    TextView tv = (TextView)findViewById(R.id.mytext);
    tv.setText(status);

        MyOtherClass myclass = new MyOtherClass();
        myclass.connect();
}

Other class is not an activity class

 // Other class
 public class MyOtherClass {
  public MyOtherClass(){
  }

   public void connect(){
    String strIP = Mtx.confRead("IPAddress");
    String strPort = Mtx.confRead("Port");

            String msg = "Connecting...";
            // i want to show value of msg varible in Textview of main activity from here
   }

thanking you

  • 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-06T01:05:17+00:00Added an answer on June 6, 2026 at 1:05 am

    Make a status instance field in your main activity

    public static status = "initial status";
    

    set it to the TextView

    TextView tv = (TextView) findViewById(R.id.youtTextViewId);
    
    tv.setText(status);
    

    and update it using values in other activities when they are called.

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

Sidebar

Related Questions

I'm an Android newbie, and working on an app which needs an Options menu.
posting from an app (iOS android etc..) not a web form. class someImage(models.Model): image
I am a newbie to Android development. I am writing an app for my
I have the following thing to achieve in Android(newbie). I have an xml which
I am a newbie to android app development. I want to customize my android
Newbie question. After I have written the Android App (easy part) I need to
I'm writing an Android app for work that shows the status of our phone
I am a newbie in Android app development, I tried to create a nested
I am a newbie to Android app development. For 1 of my project, I
I've just written a short Android app which stores userdata in the phone-side sqlite

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.