I have two class files. One which creates and stores a value in a string (PINString). The second class file uses the variable to show in a textView. as shown below: Currently the calue of the variable PINString isnt being passed through
First
{
//
int randomPIN = (int)(Math.random()*9000)+1000;
//
String PINString = String.valueOf(randomPIN);
Intent i = new Intent(getBaseContext(),verification.class);
i.putExtra("PINString", PINString);//transfer string
startActivity(i);
}
Second
public void onClick(View view)
{
String PINString;
Bundle bundle = getIntent().getExtras();
PINString = bundle.getString("SMSDemo.PINString");
TextView textView2 = (TextView) findViewById(R.id.textView2);
textView2.setText(PINString);