public TextView textView;
public TextView textView1;
//Bank bank = new Bank();
// public int myNumber1;
//public int myNumbe
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
textView = (TextView) findViewById(R.id.textView17);
textView1 = (TextView) findViewById(R.id.textView18);
int element = Integer.parseInt(textView.getText().toString());
final int element1 = element * 3;
textView1.setText("" + element1);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, Bank.class);
startActivity(intent);
}
});
}
Asked
Active
Viewed 93 times
-3
-
4Which variable? Which other class? A little more context would be helpful – 0xDEADC0DE Aug 16 '17 at 14:13
-
I think your question not proper, please added some text with a code for better understanding. – Kishan Donga Aug 16 '17 at 14:16
-
https://stackoverflow.com/a/4967833/8200290 – letsCode Aug 16 '17 at 14:22
1 Answers
0
First - as others have said in comments, please put more information so others can help you. Looks like these are the controls/variables you are trying to share with other classes
public TextView textView;
public TextView textView1;
int element;
You can pass these into another class via
- Constructor arguments
- Methods
- Public fields (i personally don't prefer this)

James Poulose
- 3,569
- 2
- 34
- 39