Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7589123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:05:12+00:00 2026-05-30T20:05:12+00:00

I am developing flashlight app. I want to set time like 2mins, 3mins and

  • 0

I am developing flashlight app. I want to set time like 2mins, 3mins and unlimited for the flashlight to be on. How can I do that?
First of all I am checking whether flashlight is available or not. If it is, I want to set the brightness to maximum.

My code contains the following.

if (flashcheck) {
            camera = Camera.open();
            parameters = camera.getParameters();
            parameters.setFlashMode(Parameters.FLASH_MODE_TORCH);
            camera.setParameters(parameters);
        } else {
            WindowManager.LayoutParams localLayoutParams = getWindow()
                    .getAttributes();
            localLayoutParams.screenBrightness = 1F;
            getWindow().setAttributes(localLayoutParams);
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:05:13+00:00Added an answer on May 30, 2026 at 8:05 pm

    You can use the Handler for this, Check the below example:-

    Handler handler=new Handler();handler.postDelayed(new Runnable() {
    
    @Override
    public void run() {
    // TODO Auto-generated method stub
    // write the code here that will be executed after 2000 milliseconds.               
    }
    
    }, 2000);
    

    Whatever Runnable object you will pass as handler’s document, it will execute after 2000 milliseconds (means 2 seconds).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am developing an flashlight application in which I want to give option to set
Am developing a genetic algorithm in Java, that like all of them, requires the
Developing a Sencha Touch MVC app that pulls data from json store (thats set
Developing an app that people pay a monthly subscription to use. They can pay
I´m developing an ASP.NET MVC app that uses EF 4.1 Code First. I have
developing iphone app, I have used a UIImageview and i have set an image
Developing an app where all tabular data is returned as an object. Some cells
Developing with my first Mac and I noticed that my Rspec output isn't colorized
Developing an application for Android, i want to record data that will be usefull
Developing a web application that I've registered with Twitter. In this app, I might

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.