-1

I am developing a user interface launcher for the Android Platform running in Java programming.

Currently, I am trying to implement a way for the user to long press (Touch and hold) their homescreen and it would open up the camera flash.

Is this something that could be implemented?

Thanks for any info, Evan

1 Answers1

1

You can set an onLongClickListener on a button. Something like this:

Button buttonFlash=(Button)findViewById(R.id.yourFlashButton);

buttonFlash.setOnLongClickListener(new OnLongClickListener() { 
        @Override
        public boolean onLongClick(View v) {
            // Turn on the flashlight
            return true;
        }
    });