android


Android ActionBar API, getSupportActionBar() and setDisplayHomeAsUpEnable meaning?


I added a icon on the action bar. And when i click on it, it opens another activity via intent. However, in some source, people add getSupportActionBar and setDisplayHomeAsUpEnable. Even if without those, it still works.
My question is what is the meaning og these 2 API?
If you have included actionBar or toolbar in your activity and if you want to go to previous activity on the tap of back arrow on the left side (in LTR configuration) of your actionbar, you will have to first get actionbar as,
ActionBar ab = getSupportActionBar();
and then provide action which is go to previous activity and for that you will have to call setDisplayHomeAsUpEnabled() method as,
if (ab != null) {
ab.setDisplayHomeAsUpEnabled(true);
}

Related Links

Can I programmatically choose the Android layout folder?
One APK that launch a different activity if its mobile or tablet (Android 2.1+)
Battery notification in every application that is running
OpenGL ES render glitches
Android Acessibility API contentDescription
SD Card Video is not playing?
android:null pointer exception in airplane mode
Android - gridview scrolling issue (very slow scroll)
How can I know in my own view that device orientation has changed?
Android OpenGL ES Textures Showing On Black screen on Some Samsung devices
Is it possible to develop an application using phonegap plus sencha touch
Null pointer on imageview.setBackgroundResource
YouTube Java API vs Android REST Client implementation
android:inputType=“textCapSentences” Not Always Honored
OnClickListener() must override a superclass method?
How to execute a code when the application is launched

Categories

HOME
sonarqube
paraview
polymer
jmeter
apache-jena
phpmyadmin
nunit
powerpoint
jmx
interface
solver
bitbucket-api
dojo
ado.net
missing-data
vert.x
teechart
spin
pattern-matching
arangodb
pcl-crypto
xcodebuild
searchview
firefox-addon
nim
database-connection
sar
dataflow-diagram
itunes
licensing
genexus-sd
calculation
google-cast
custom-controls
send
python-2.6
angularjs-material
twos-complement
instantiation
classcastexception
browser-extension
roblox
parse-tree
google-earth-engine
mongoose-schema
microsoft-metro
glm-math
placeholder
stylecop
snapchat
plan-9
puredata
flask-restful
opennms
dotnet-httpclient
facebook-pixel
arq
omxplayer
x-tag
wso2developerstudio
cassia
exim4
httpruntime.cache
roadkill-wiki
flock
opserver
atoi
nsurlsessiondatatask
rrule
broadband
exceldatareader
mass-assignment
primitive-types
addressing-mode
sql-scripts
psr-4
imagefilter
paste
visual-studio-express
eclipse-kepler
artemis
http-patch
model-driven-development
beaker-testing
joomla-template
server-administration
joomla3.1
pstack
nokia-s40
boost-msm
agility.js
xcelsius
creole
socketserver
squishit
updatesourcetrigger
easyb
web-garden
sifr
skype4java
lobo-cobra
windows-identity
cardspace
great-circle

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App