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

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -