How to code in Activity Starter

Please help to code this snippet in activit

Intent Down= new Intent(Intent.ACTION_MEDIA_BUTTON); Down.putExtra(Intent.EXTRA_KEY_EVENT,
new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_HEADSETHOOK));

Regards
Zama

hope this helps you:
http://ai2.appinventor.mit.edu/reference/components/connectivity.html#ActivityStarter