Activity not being created

I’m trying to show a confirmation screen once a fall is detected. If the fall is detected, i call ‘showConfirmation’, which follows the following flow:

Method called when fall is detected:

public void showConfirmation(Context context, String data) {
        Intent intent = new Intent(context, CaidaActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.putExtra("data", data);
        startActivity(intent);
    }

Activity to show:

public class CaidaActivity extends AppCompatActivity {

    private String data;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        data = getIntent().getExtras().getString("data");
        actualizarTextos(R.string.caida_texto, R.string.caida_aceptar, R.string.caida_cancelar);
        playSonido();
        playVibracion();
        startContador();
    }
...

I’ve tried the very basic print(“here”) method of debugging and turns out method ‘onCreate’ is never called in the firt place. Anyone knows why?

  • give your exact error to find the exact error occurred on the code.

    – 

  • did you set this in your activity? setContentView(R.layout.activity_main)

    – 

Leave a Comment