How to pass value from 1 class method to another class activity
strong text
public class A extends Activity{
int value;
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
.
.
.
methodA();
}
public void methodA(){
if (condition){
value =1
}
else if (condition){
value =2
}
else{
value =3
}
}
}
}
class B
Public class B extends Activity{
protected void onCreate(Bundle savedInstanceState){
int val;
super.onCreate(savedInstanceState);
.
.
//how do we can get val = value
}
}
Question is how can val
from class B get the value
from class A, will intent work for these condition?