I have a lot of problems when using getter and setter and without examples that help me, it's hard for me to understand what I want ..
I'll explain.
I have this part my code:
// Acció button Aceptar
class BtnAceptar implements ActionListener {
@SuppressWarnings("unused")
@Override
public void actionPerformed(ActionEvent e) {
// Creem les variables que utilitzem per registrar usuaris etc..
String soapEndpointUrl = "http://gamificacioc.com:80/ServerGIOC/webservices";
String soapAction = "http://gamificacioc.com:80/ServerGIOC/comprovarLogin";
//Recollim les dades dels buttons e inicialitzem variables
String usuari = txtUsuari2.getText();
String usuariContrasenya = textPassword2.getText();
WebServiceCalls calls = new WebServiceCalls();
Object authId = null;
//Exemple sense recollir la info dels butons ho tinc per probar directament sense recollir dels buttons
// System.out.println(calls.comprovarLogin("fbarcia", "password"));
//Recollin't la info dels buttons.
SoapObject resposta = calls.comprovarLogin(usuari, usuariContrasenya);
if (resposta == null)
{
JOptionPane.showMessageDialog(null, "Error falten dades");
}
else
{
//Si els buttons son plens verifica que sigui correcte
authId= resposta.getPrimitiveProperty("authId");
//authId ens dona el resultat que volem pasar per saber el tipus User
//Enviem l'authId per poder saber que usuari es...
String resposta2 = calls.tipusUsuari(authId.toString());
System.out.println(authId);
The issue is that I need to recover the authId to use it in another class, but I would like it not to be with a global variable and I do not know how to do it ..
Can you help me understand?
thanks