public void n_ot() {
num_of_tr.get().addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
if (documentSnapshot.exists()) {
//String amount_not = documentSnapshot.getString(AMOUNT);
//anotherClass.setAmountNot(amount_not);
anotherClass.setAmountNot(documentSnapshot.getString(AMOUNT));
}
}
});
}
public class AnotherClass{
String amount_not;
//...
public void setAmounntNot(String value){
this.amount_not = value;
}
//...
}
public void play (View v) {
if (player == null) {
player = MediaPlayer.create (this, R.raw.song);
}
player.start();
showImage(R.drawable.id_image);
}
public void showImage(int idImage){
findViewById(R.id.imageView).setImageResource(idImage);
}