android - ImageSwitcher in fragment throws illegalstateexception but works in an activity -
my code works when in activity. however, decided change fragment, , throws illegalstateexception viewswitcher. can't figure out wrong. in summary, have images use placeholders. when upload image button clicked, fetches uri returned path , uses replace placeholder image in imageswitcher. here's code: private button buttonupload; private imageswitcher imageswitcher; private imagebutton imagebutton0; private imagebutton imagebutton1; private imagebutton imagebutton2; private imagebutton imagebutton3; private imagebutton imagebutton4; private arraylist<string> photoarray; int counter = 0; private static int load_image_results=1; private static int placeholder_image = r.drawable.placeholder_2; int[] imgs = {r.drawable.pic1, r.drawable.pic2, r.drawable.pic3,r.drawable.pic4,r.drawable.pic5}; @override public view oncreateview(layoutinflater inflater, viewgroup container,bundle savedinstancestate) { // todo auto-generated method stub view rootview = inflater.in...