简体   繁体   中英

Up button in the action bar

I have three activities as i go to second or third activity no Up button (left-facing caret alongside the app icon) showing in the those activities . I targeted for SDK 4.1 Jelly Bean.

I placed the below code in oncreate method

getActionBar().setDisplayHomeAsUpEnabled(true);

but nothing shows "Up icon" in action bar

plz suggest any code to appear UP icon in the action bar.

make sure your android:minSdkVersion="11" which could be seen in the manifest file, Up icon has been included from APK 11. For home page put getActionBar().setDisplayHomeAsUpEnabled(false); make sure it false and on other activities you keep it enabled i,e "true". i have made a small sample plz try the below link which may be help you just import into your work space

http://www.mediafire.com/?hktdvts7yyduwv1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM