|
Register •
FAQ
• Search • Login
|
|
Page 1 of 1
|
[ 2 posts ] |
|
Author |
Message |
kosaanta
Joined: 21 Sep 2012, 10:24 Posts: 10
|
Fragment replacment
Καλημέρα θα ήθελα να κάνω μια ερώτηση αν μπορείτε να με βοηθήσετε. Έχω ενα fragment με 1 action bar item menu. Το κάνω replace και στο επόμενο fragment ο τίτλος του είναι της μορφής Cust... (αντι για Customer Profile) και αντί για 2 items sto action βαρ μου εμφανίζει μόνο 1. Επίσης δεν μου εμφανίζει τίποτα στο content frame άσπρο background. Αν κάνω rotate την συσκευή η κλείσω και ανοίξω την οθόνη τα φορτώνει όλα κανονικά. Με λίγα λόγια αν κάνει refresh το fragment είναι όλα καλά. Σκέφτομαι μήπως έχει κάποιο θέμα με το πρώτο fragment και σκαλώνουν τα menu και οι τίτπλοι.
Έτσι δημιουργώ το ρχικό fragment:
CustomerProfile fragment = new CustomerProfile(); FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction().replace(getResources().getIdentifier("content_frame", "id", getPackageName()), fragment).commit();
Και έτσι κάνω replace το επόμενο fragment που έχω και το πρόβλημα:
CustomerProfileEdit mProfileEdit = new CustomerProfileEdit(); FragmentManager fm = getFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); ft.replace(R.id.content_frame, mProfileEdit); ft.addToBackStack(null); ft.commit(); fm.executePendingTransactions(); getFragmentManager().executePendingTransactions();
|
28 Apr 2014, 13:04 |
|
|
Ultimus
Joined: 09 Aug 2012, 13:03 Posts: 17
|
Re: Fragment replacment
Καλησπέρα. Τελικά έλυσες το πρόβλημα; Εκτός του ότι καλείς 2 φορές την executePendingTransactions() δε βλέπω κάτι λάθος στον κώδικα που δείχνεις.
|
16 May 2014, 20:53 |
|
|
|
|
Page 1 of 1
|
[ 2 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 36 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|