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

  • Home
  • SEARCH
  • 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 6817575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:04:21+00:00 2026-05-26T21:04:21+00:00

I’m making a information app for Android and I can’t figure out how to

  • 0

I’m making a information app for Android and I can’t figure out how to change a button depending on which button was pressed in a previous class.

I made this picture that shows how the app works:

Flowchart

After clicking the first button you get to a new class with 2 new buttons that sends you to the same class but the 3 buttons there is supposed to change depending on which one of the two buttons you pressed, the three buttons you get sent to sends you to the same class but there is a TextView that changes text depending on what button you pressed.

So I need to add some kind of information to the button (an intent?) so it knows what you pressed earlier.

I’m kinda new to Java and Android so I’m sorry if I explained in a weird way.

Thanks in advance

  • 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-26T21:04:21+00:00Added an answer on May 26, 2026 at 9:04 pm

    Each time you start a new Activity, but some extras in that intent telling the next activity what the buttons should display. In the next activity, read the extras from the intent you got, and programatically set your buttons’ text accordingly.

    Here’s some psuedo code.

    public class FirstActivity extends Activity{
    
       //setup button 1 and two first, then set their onClickLiseners like so
    
       View.OnClickListener clickListener = new View.OnClickListener(){
          public void onClick(View view){
            Intent newActivity = new Intent(FirstActivity.this, SecondActivity.class);
            if(view == button1){
              //add extra to intent indicating button1 was clicked
            }
            else{
              //add extra to intent indicating button2 was clicked
            }
            startActivity(newActivity);
          }
        };
    
    
      // other stuff in your activity
    }
    
    
    public class SecondActivity extends Activity{
    
      protected void onCreate(Bundle icicle){
         Intent startedBy = getIntent();
         if(started by has the extra indicating button 1 was clicked){
           //do button1 stuff
         }
         else{
           //do button2 stuff 
         }
       }
    }
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string

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.