how to retrieve the selected string in another class
toast and show if there is a choice the same string
declaration is included in the button script set.OnCLick …
usig if else
if (
getString(R.id.spin1, equals("Book") ==
getString(R.id.spin2, equals("Book")){
Toast.makeText(getBaseContext(), "error", Toast.LENGTH_SHORT).show();
`enter code here`
}
spin1 is spinner from class A and spin2 is Spinner from class B, but this but the script is not the way?? please help me….???
You can use shared preferences for storing and retrieving values :
simple demo to store value is
for more information check this link:
http://developer.android.com/reference/android/content/SharedPreferences.html