• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Interacting with Keys in Android

Hi,
I'm new to Android and I want to use Back key in my application. My application is openeing some network connections and downloading some data from there. While netwrok connection is in process I'm showing a progress dialog window. I want this window to be disappear and connection to be reset when I press Back key. I'm trying onKeyDown() method but it is not getting called.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones