I am making a Flashlight application and I am using fragments. When I press the button, the light of the flashlight is delayed for more than 4 seconds, and I do not know what will happen. Also, when I press the switch button again, the flashlight does not turn off. Any idea?
I would also like to make a strobe light with another button.
I am searching on the Internet, but I have not found another option to create this function, only this.
this is my code
import android.hardware.Camera; import android.hardware.Camera.Parameters; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Switch; public class HerramientasFragment extends Fragment { private Camera cam; private Switch linterna; public HerramientasFragment() {
source share