mardi 31 mars 2015

findViewById() returns null while using it in test clas?

I have a layout (main_layout) that i inflate in the fragment. Now when i try to access it from test class using the following:



View testLayout=getActivity().findViewById(R.layout.main_layout);


It returns to me null? Can anyone tell me whats the wrong thing i am doing?


Aucun commentaire:

Enregistrer un commentaire