Why does my app force close on moving from one fragment to another on a ImageView click in Android? -
i trying move mycontacts extends fragment tasks extends fragment on clicking imageview . imageview in listview generated using simpleadapter .the ids of layouts follows: r.id.tasky tasks fragment, r.id.mycontacts mycontacts fragment. codes , error logs follows. new fragments kindly explain me step step. mycontacts extends fragment purple.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub android.app.fragmenttransaction t = getactivity().getfragmentmanager().begintransaction(); fragment fragment = new tasks(); fragmentmanager fragmentmanager = getactivity().getsupportfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); fragmenttransaction.replace(r.id.tasky, fragment); fragmenttransaction.addtobackstack(null); fragmenttransaction.commit(); } }); error logs: 04-22 04:41:52.486: e/fragmentmanager(3250): ...