Dialog appears only after it has been called

3

Hello

In my application, I have a Button , which when clicked, opens the device camera for the user to take a photo:

@Override
public void onClick(View v) {
    //dialog da minha aplicação
    final ProgressDialog dialog = MobileUtils.getBasicProgressDialog(getBaseContext());

    // Cria uma intent para capturar uma imagem e retorna o controle para quem o chamou 
    Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
    ...
}

The application should show Dialog before going to the camera, but it will stop for 5 seconds, open the camera, and the dialog will only be shown on the back. Is there a way to only open the camera AFTER Dialog appears?

    
asked by anonymous 10.12.2015 / 19:47

1 answer

-1

This will call the camera after 15 seconds:

final Runnable runnable = new Runnable() {
    @Override
    public void run() {
        // Isto será chamdo após 15 segundos...
        Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
    }
};
new Handler().postDelayed(runnable, 15000);
    
10.12.2015 / 19:57