Wednesday, 15 January 2014

android - Providing Up (aka Back) Navigation - with UI Fragments -


Google Doc tells you how the button above in an app with multiple people Display activities (by specifying "parent" activities in AndroidManifest.xml):

screenshot

Although I'm working on a Bluetooth application (starts with minSdkVersion = 18 ) where single is the main activity and There are 3 pieces:

  • Mainforgement. Java
  • S
  • That's why I used the ActionBarActivity :

      MainActivity ActionBarActivity implements BleWrapperUiCallbacks {  

    and I setDisplayHomeAsUpEnabled (true) call method:

      @Orride Bundle Saved InstantStat) {super.onCreate (savedInstanceState); RequestWindowFeature (Window.FEATURE_INDETERMINATE_PROGRESS); SetContentView (R.layout.activity_root); GetSupportActionBar () setDisplayHomeAsUpEnabled (true).  

    This displays up button in my app, but I still have 3 questions:

    1. Up button (when I'm showing the mainframe)?
    2. How to "wire" the up button - does it currently touch nothing?
    3. What do I use instead of the following line in my AndroidManifest.xml? Android: Theme = "@Android: Style / Theme. Holo.NoActionBar"

I can answer the second question to provide navigation by overriding this method:

  Public Boolean Onoptsim selected (menu items) {Switch (item .getItemId ()) // // Response to Home button case Android at the top of the action bar. R.DHOM: Neville. NaveetupframeSmacket (this); Back true; } Return Super.Options item selected (item); }  

No comments:

Post a Comment