android - One fragment with two types of display -


i need fragment shows in container , shows dialog.

this sample code maybe help

myfragment frag=new myfragment();  //sometimes    fragmentmanager fragmentmanager = getsupportfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); fragmenttransaction.add(r.id.container, frag, tag);  //sometimes  frag.show(getfragmentmanager(), null); 

you can use fragment extends dialogfragment either embedded view or dialog. please refer part of guide in documentation detailed explanation. have used approach , works perfectly. http://developer.android.com/reference/android/app/dialogfragment.html#dialogorembed


Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -