android - Fragment instanceof in onItemClick -
im using array adapter fragments , on item click action should start fragment
fragment f = (fragment) parent.getitematposition(position); if (f instanceof myfragment) { newcontent = new myfragment(); }
if clause false , dont know why
there problem?
try this,
object f = class.forname(applicationsession.getinstance().getapppackage() + "." +parent.getitematposition(position)).newinstance(); if (f instanceof myfragment) { newcontent = new myfragment(); }
Comments
Post a Comment