Can android application overwrite the volume down/up key's behavior?

by AlCapwn » Fri, 13 Mar 2009 02:41:25 GMT


Sponsored Links
 You can override dispatchKeyEvent which should do the trick.



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. notifydatasetchanged in a ListView and handle Event click

Hi,

I've a ListView that is updated via the "notifydatasetchanged" methods
in a AsyncTask.
The items of my ListView contains checkbox.

The problem is when I click on one item checkbox while the listView is
updated, the checkbox state gets back to default. This happens until
the listView is fully updated.

I would like to maintain the new checkbox state even while the
listView is updated.

Can anyone help me?

Thanks
Tom

--~--~---------~--~----~------------~-------~--~----~

2. Capture key pressed

Hi,

        i want to capture when user press the EndCall key in simulator, but
i think i'm doing something wrong cause nothing happens!
        My code is:

public class MakeACall extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent = new Intent(Intent.ACTION_CALL);
        intent.setData(Uri.parse("tel:99999999"));
        startActivity(intent);
        setContentView(R.layout.main);
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent ev) {
        switch(keyCode) {
            case KeyEvent.KEYCODE_ENDCALL:
                System.out.println("Terminou!!");
                break;
            default:
                return false;
        }
        return super.onKeyDown(keyCode, ev);
    }
}

   Can anybody help me?

[]s,
     Michelle.

--~--~---------~--~----~------------~-------~--~----~

3. left handed user

4. Input method for decimal numbers

5. EditText border/background

6. Add menu icon programatically

7. TelephonyManager.getNetworkType() returns 4 on HTC Hero