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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:26:40+00:00 2026-06-14T22:26:40+00:00

my program is suposes to change bname to position but won’t for some reason

  • 0

my program is suposes to change bname to position but won’t for some reason
I send position to Record Expeance this waycase
R.id.record_expeance:

    startActivity(new Intent(BudgetStart.this, RecordExpeance.class));
    ex.changeName(position);
    BudgetStart.this.finish();
    break; 

after that is should be equal to position but it remains null I’m not sure if this is cause I start that class new or something but I can’t figure it out

package budget.app;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class RecordExpeance extends Activity implements OnClickListener
{    
    private String bname;
    protected void onCreate(Bundle savedInstanceState) 
    {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.recordexpeance);
        final BudgetDB entry = new BudgetDB(RecordExpeance.this);
        EditText a =(EditText)findViewById(R.id.txtExpeance);
        EditText b =(EditText)findViewById(R.id.txtEMomo);
        TextView c =(TextView)findViewById(R.id.lblBudgetAmount);
        TextView d =(TextView)findViewById(R.id.lblBudgetName);
       d.setText(bname);

        String bamount;

        entry.open();
        bamount = entry.getBamount(bname);
        entry.close();

        Button A = (Button)findViewById(R.id.btnFinish);

        A.setOnClickListener(this);
    }

    public void onClick(View argo) 
    {
        // TODO Auto-generated method stub
        startActivity(new Intent(RecordExpeance.this, BudgetStart.class));
        RecordExpeance.this.finish();
    }
    public void changeName(String position) 
    {
        // TODO Auto-generated method stub

        bname = position;
    }
}
  • 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-14T22:26:41+00:00Added an answer on June 14, 2026 at 10:26 pm

    It would be easier to pass position in the Intent:

    Intent intent = new Intent(BudgetStart.this, RecordExpeance.class);
    intent.putExtra("position", position);
    startActivity(intent);
    BudgetStart.this.finish();
    break; 
    

    Then read it from the Intent in RecordExpeance:

    super.onCreate(savedInstanceState);
    setContentView(R.layout.recordexpeance);
    
    bname = getIntent().getIntExtra("position", 1); 
    // Where 1 is the default value if you forgot use putExtra()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This program runs just fine, but for some reason when I ask for an
My program requires some configuration details to be kept in a .ini file. This
Program that calculates and shows the value of (2 to the 10th power) This
This program builds a dictionary out of a list based on what two index
This program returns: package main import ( flag fmt ) func main() { num_agents
program s; type info = record name, surname: string; min, sec: integer; end; arrays
Program: program s; type info = record name, surname: string; min, sek: integer; end;
This program so far has one purpose, take in two integers(the size of the
Program I'm making has a simple configuration file looking something like this. @overlays =
My program is to print the queue of information from a file but 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.