Android: DialogFragment and universal xml -


i trying take control of database in android dialog fragments. mean, example add new record click button , pop-up fragment appears asking me specific fields. click ok fires method in hosting activity. part works.

however, want have other operations delete, update, search record ect.

is there way have universal code fragment assign different xml according different database operations? looking efficient way around problem.

thanks!

you can inflate different views on fragment...

public class myclass extends fragment { string xmltoload;  @override public void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstances);     bundle data = getarguments();     xmltoload = data.getstring("what set in fragments pager"); }  @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) {     if(xmltoload.equals("whatever")) {         view view = inflater.inflate(r.layout.thisxml, container,false);     } } } 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -