so i have a two fragment layout, left fragment is a ListFragment, and the right is my displayfragment. I click an item on the left to change the display on the right. at one point i open up a Alertdialog box, when the OK button is clicked, i'm trying to either remove the current display fragment, or at least replace it with a blank one. I'm a Java Noob, so please help me get this working. currently i have this method in my main activity class:
public void clearPreview() { RightFragment details = (RightFragment) getFragmentManager().findFragmentByTag("SUBMIT_TAG"); } i'm calling this method from another class using: MainActivity sr = new MainActivity(); sr.clearPreview(); and even though the fragment exists, details is still coming up null, why? I've even used: public void clearPreview() { RightFragment details = (RightFragment) getFragmentManager().findFragmentById(R.id.detailfragment); } Any help will be greatly appreciated! Thanks -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en