android – How to send data to the constructor?

Question:

I need you to help me understand the part of object programming.

I needed to pass a value that was not inside the test object to know what the user's choice was. But once again I am a beginner in objects.

How do I have to call in my main activity to receive the choice?

public class organizadist {

    public organizadist()
    {

    }

    public teste[] inicializa(teste[] objecto) {
// o que eu queria receber
if (escolha==1){
// faz alguma coisa 
}
if (escolha==2){


//faz outra coisa 



    }


    public static class teste {
        public int ola;


    }

}

Answer:

Simple learned this yesterday curiously.

In your activity:

 organizadist enviadados = new organizadist();
                organizadist.Teste array [] = enviadados.inicializa(listaClothes ,  escolha);

In its constructor: `

public teste[] inicializa(teste[] objecto , int escolha);
Scroll to Top