android - OnBack Press Fragment showing blank Screen -


i using fragments in application.so on home page have grid view of 5 item on selection of again opening new fragment .

so happening on press showing blank screen after closing application .

please suggest me have done wrong in this.

mycode

gridview.setonitemclicklistener(new onitemclicklistener() {             @override             public void onitemclick(adapterview<?> arg0, view v, int arg2,                     long arg3) {                 if (dashboard_links[arg2].equals("a")) {                     fragtran.replace(r.id.content_frame,                                 firstfrag);                         fragtran.settransition(fragmenttransaction.transit_fragment_open);                         fragtran.addtobackstack(null);                         fragtran.commit();                  }                 if (dashboard_links[arg2].equals("b")) {                     fragtran.replace(r.id.content_frame, secondfrag);                     fragtran.settransition(fragmenttransaction.transit_fragment_open);                     fragtran.addtobackstack(null);                     fragtran.commit();                 }                 if (dashboard_links[arg2].equals("c")) {                     fragtran.replace(r.id.content_frame, thirdfarg);                     fragtran.settransition(fragmenttransaction.transit_fragment_open);                     fragtran.addtobackstack(null);                     fragtran.commit();                 }             }         }); 

please happening

my suggestion let addtobackstack(null) in fragment call.

but remove line addtobackstack(null)

from homepage after onbackpress getting blank screen hope .


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

angularjs - ng-repeat duplicating items after page reload -