"back button" function

by dai » Sat, 13 Sep 2008 13:16:56 GMT

Sponsored Links
 ciao, does someone know what/how android implements the back button?
If I add back button myself, Do I have to do something(use stack to
remember activity) myself?

Thank you so much

"back button" function

by Jeff Hamilton » Sat, 13 Sep 2008 13:25:58 GMT

 The Activity class will call finish() on itself if you do not
explicitly handle KEYCODE_BACK in your Activity's onKeyDown()
function. In general the system maintains a stack of activities for
you, pushing a new one when you call startActivity() and poping one
when the user hits back or you call finish() on an activity.

You can create a single activity that manages its own internal stack
of states, but it's much easier to create a new subclass of Activity
for each state you want and let the system handle that for you.



Sponsored Links

Other Threads

1. SE X10 Mini Pro

up2 semua,masih belum dapat nih barangnya
mungkin ada yg mau ngejapri lagi untuk x10 MP yg BNIB ke saya?
soalnya besok jumat,hari jualan nih hehehe.. :D


2. WTHelp: sd card tiba2 blank

Suhu Suhi, tolong dunk... kok tiba2 sd card blank n dibilang has unsupported
filesystem. Tadi abis donlot rom darkslide buat dx


3. partial wakelock for 3G in Android

4. Prevent application - after Factory Data reset

5. [WTReview] Desire, Gingerbread ROM ; Oxygen v2.0-RC6 (Cleanest, Fastest!)

6. Update wtb evo & wta suhu evo yg sakti mandraguna macam gatot koco :)

7. [WTS] Aksesories Samsung Galaxy S, Tab and HTC Desire HD