Login code problem

Hello ! I’m new in android development. I have followed a tutorial to realize the first part of my app : Login/Register. I want to make an small application similar to Facebook. Here, I encounter some difficulties including the login activity code. It’s supposed to redirect me to another page (user space) but it doesn’t work. Firstly, i have thought it was an Intent problem and i checked it. Everything is OK but it didn’t work.

here my Java login code :

 package ci.project.mrstevensrims.esnmemberspace;


import android.content.Intent;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.Toast;


import com.android.volley.RequestQueue;

import java.util.logging.Handler;
import java.util.logging.LogRecord;

import ci.project.mrstevensrims.esnmemberspace.myRequest.MyRequest;

public class ConnexionActivity extends AppCompatActivity {

    private TextInputLayout til_PseudoConnexion, til_MDPConnexion;
    private Button btn_Connexion;
    private RequestQueue queue;
    private MyRequest request;
    private ProgressBar pb_loader;
    private SessionManager sessionManager;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_connexion);


        //Récu^rération du message de l'inscription
        Intent intent = getIntent();
        if(intent.hasExtra("Inscrit")){
            Toast.makeText(this, intent.getStringExtra("Inscrit"), Toast.LENGTH_SHORT).show();
        }

        til_PseudoConnexion = (TextInputLayout) findViewById(R.id.til_PseudoConnexion);
        til_MDPConnexion = (TextInputLayout) findViewById(R.id.til_MDPConnexion);
        btn_Connexion = (Button) findViewById(R.id.bConnexion);
        pb_loader = (ProgressBar) findViewById(R.id.pb_loaderConnexion);
        sessionManager = new SessionManager(this);


        //on recupère notre queue
        queue = VolleyActivity.getInstance(this).getRequestQueue();
        request = new MyRequest(this, queue);


        btn_Connexion.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                final String pseudoConnexion = til_PseudoConnexion.getEditText().getText().toString().trim();
                final String MDPConnexion = til_MDPConnexion.getEditText().getText().toString().trim();
                pb_loader.setVisibility(View.GONE );

                if (pseudoConnexion.length() > 0 && MDPConnexion.length() >0){

                    request.connexion(pseudoConnexion, MDPConnexion, new MyRequest.ConnexionCallBack() {
                        @Override
                        public void onSuccess(String id, String pseudoConnexion) {
                            pb_loader.setVisibility(View.GONE );
                            sessionManager.insertUser(id, pseudoConnexion);
                            Intent connect = new Intent(getApplicationContext(), UserCompteActivity.class);
                            startActivity(connect);
                            finish();


                        }

                        @Override
                        public void onError(String message) {
                            pb_loader.setVisibility(View.VISIBLE );
                            Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();

                        }
                    });




                }else{
                    Toast.makeText(getApplicationContext(), "Veuillez remplir tous les champs", Toast.LENGTH_SHORT).show();
                }



            }
        });




    }


}

And Myrequest Java :

package ci.project.mrstevensrims.esnmemberspace;


import android.content.Intent;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.Toast;


import com.android.volley.RequestQueue;

import java.util.logging.Handler;
import java.util.logging.LogRecord;

import ci.project.mrstevensrims.esnmemberspace.myRequest.MyRequest;

public class ConnexionActivity extends AppCompatActivity {

    private TextInputLayout til_PseudoConnexion, til_MDPConnexion;
    private Button btn_Connexion;
    private RequestQueue queue;
    private MyRequest request;
    private ProgressBar pb_loader;
    private SessionManager sessionManager;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_connexion);


        //Récu^rération du message de l'inscription
        Intent intent = getIntent();
        if(intent.hasExtra("Inscrit")){
            Toast.makeText(this, intent.getStringExtra("Inscrit"), Toast.LENGTH_SHORT).show();
        }

        til_PseudoConnexion = (TextInputLayout) findViewById(R.id.til_PseudoConnexion);
        til_MDPConnexion = (TextInputLayout) findViewById(R.id.til_MDPConnexion);
        btn_Connexion = (Button) findViewById(R.id.bConnexion);
        pb_loader = (ProgressBar) findViewById(R.id.pb_loaderConnexion);
        sessionManager = new SessionManager(this);


        //on recupère notre queue
        queue = VolleyActivity.getInstance(this).getRequestQueue();
        request = new MyRequest(this, queue);


        btn_Connexion.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                final String pseudoConnexion = til_PseudoConnexion.getEditText().getText().toString().trim();
                final String MDPConnexion = til_MDPConnexion.getEditText().getText().toString().trim();
                pb_loader.setVisibility(View.GONE );

                if (pseudoConnexion.length() > 0 && MDPConnexion.length() >0){

                    request.connexion(pseudoConnexion, MDPConnexion, new MyRequest.ConnexionCallBack() {
                        @Override
                        public void onSuccess(String id, String pseudoConnexion) {
                            pb_loader.setVisibility(View.GONE );
                            sessionManager.insertUser(id, pseudoConnexion);
                            Intent connect = new Intent(getApplicationContext(), UserCompteActivity.class);
                            startActivity(connect);
                            finish();


                        }

                        @Override
                        public void onError(String message) {
                            pb_loader.setVisibility(View.VISIBLE );
                            Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();

                        }
                    });




                }else{
                    Toast.makeText(getApplicationContext(), "Veuillez remplir tous les champs", Toast.LENGTH_SHORT).show();
                }



            }
        });




    }


}

 Please could you help me !!

Hi @stevrims,

This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our Community organized so users can more easily find information.

As you’ll notice, your Topic is now in the Project Development Help and Advice board. No action is needed on your part; you can continue the conversation as normal here.

Let me know if you have any other questions or if I can help with anything else.

Cheers!