Passing a variable from Java class to another for Android
<p>Screen2.java file has the following code :</p>

<pre><code>public class screen2 extends Activity {

    public int globalZip=0;
        //Some validations &amp; update globalZip
        //Code control goes to Screen3,java

}
</code></pre>

<p>Screen3.java file has the following code :</p>

<pre><code>public class Screen3 extends Activity
{
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.screen3);
        screen2 objs2= new screen2();
        int myzip = objs2.globalZip;

        Toast.makeText(getBaseContext(), "Screen3 "+myzip, 5).show();

        System.out.println("WTHDude"+"Screen3 "+myzip);

    }
</code></pre>

<p>Now the problem i am having that if i have updated value of globalZip in Screen2.java file as 90034 it is not getting updated in the screen3. Can anyone help me with this error. Thank you. </p>
