I'm trying to change an image of an ImageView from a fragment by using setImageResource(R.drawable.etape_todo); but the application crashes without any logs.
Do you have any idea ?
Thanks a lot Max
public class PlateauJeu extends Fragment {
public static ImageView EtatEtape1;
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.plateau_layout, container, false);
ImageView etatEtape1 = (ImageView) view.findViewById(R.id.imageViewEtape1);
PlateauJeu.EtatEtape1.setImageResource(R.drawable.etape_passed);
return view;
}
public static void nouvelleEtape(Context context){
EtatEtape1.setImageResource(R.drawable.etape_todo);
}
}