In my Android app, I have to use a common string value for all actions. "commonValue" is the common string value that I want to use in all actions. Corresponding main action code:
public class TestActivity extends Activity { public String commonValue;
In my next step, I created an object of the TestActivity class and tried to assign the string "testValue" to another string named "str"
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.testlist); TestActivity obj = new TestActivity();
but the value of "str" ββin the second activity is not equal to the value assigned in my first action. Why is this and how can I do this?
Thanks!
source share