Sunday 15 September 2013

android - Fragments not showing title after application is resumed? -


I have a strange problem that I have never seen so that I have resorted to posting here is quite clear

I have a simple SherlockFragmentActivity as shown below, which has three pieces, all the call getActivity (). SetTitle () in their onCreateOptionsMenu () allows my app to change titles, depending on which piece is visible. It works as desired by exit the HOME button occasionally through my application, but for some reason (maybe unrelated) reopening the application again Will appear on It seems that I should close my app and open it again, it is okay, but after leaving it for a while I will not have a title on reopening it again.

I do not know at all why this may be the reason why any help is appreciated. The layout of my application (related to this issue) is a basic splash screen (in the form of an activity) with a loading bar, which is the following FragmentActivity :

  import Opens com.actionbarsherlock.app.ActionBar; Import com.actionbarsherlock.app.SherlockFragmentActivity; Importroid.os.Bundle; Import android.support.v4.view.PagerAdapter; Import android.support.v4.view.ViewPager; Import static java.lang.Math. *; Public category fragment control Sherlock Fraudgmentation Activity (Private static final integer NUM_PAGES = 3; Private viewupgigger; MPEG; Private pager adapter; mPagerAdapter; @ Override - Protected zero - Create (Bundle saved instenstate) {Super.New (savedinstenstate); setContentView (R) .layout.fragment_control); Actionbier Action = getSupportActionBar (); action.setDisplayShowTitleEnabled (correct); action.setDisplayShowHomeEnabled (wrong); Find MPager = (Viewpoint) VVIBiID (R. EPaper); MPagerAdapter = New FragmentControlAdapter (getSupportFragmentManager (), NUM_PAGES); mPager.setAdapter (mPagerAdapter); // If this activity is not called after reload then ((integer) getIntent (). GetExtras (). ("Present") == faucet) {// Always start at the middle page, or as close to the MPager.setCurrentItem ((int) CIL (NUM_PAGES / 2)); // otherwise we can For the simplest experience start on the left page] and get {mPager.setCurrentItem (integer) getIntent (). GetExtras () ("Current"). }}}   

Only when the app is opened on fragment activity , I see this problem when reopening something else and navigating this activity It is ok to do (

any and all help is appreciated, hope that I have made it clear.

Oh, and if it matters that I am present I'm targeting API 17 in the minimum support for API8. I am seeing this problem. An HTC One S is - Not yet sure on other devices but I am going to start looking for.

Sometimes after leaving this for some time (...) it looks like your application process. Meanwhile

example state using onSaveInstanceState Be sure to save (as the title is displayed) and it will be Activity.onCreate or piece. A .

No comments:

Post a Comment