I am developing an application which decode's a string of characters that i put in the text field.
Then I press the button to decode the string of characters
I have build the application and then when i open it with my phone and when i open the application and put some caractere in the EditText and then i push decode the application close
this is my code
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity">
<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/editText"
    android:layout_alignParentTop="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true" />
<Button
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="decoder"
    android:id="@+id/button1"
    android:layout_below="@+id/editText"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true" />
 </RelativeLayout>
MainActivity.java
package com.ghassensoussi7.decoder;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity  {
    private Button button1;
    private EditText editText1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        button1 = (Button) findViewById(R.id.button1);
        editText1  = (EditText)  findViewById(R.id.editText);
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String [] strings = 
  editText1.getText().toString().split("/");
                String s1 = strings[0];
                String s2 = strings[1];
                int s3 = Integer.parseInt(strings[2]);
                String s4 = s2 + s3;
                String s5 = strings[3];
                //1ere caractere   c'est une lettre
                if(s1.equals("a") || s1.equals("b") || s1.equals("c")) {
                    Toast.makeText(MainActivity.this, "tu appartient a la 
  classe 1-1 ", Toast.LENGTH_LONG).show();
                }
                else
                    if (s1.equals("d") || s1.equals("e") || s1.equals("f")) 
 {
                        Toast.makeText(MainActivity.this, "tu appartient a 
 la classe 1-2 ", Toast.LENGTH_LONG).show();
                    }
                else
                    if (s1.equals("g") || s1.equals("h") || s1.equals("i")) 
 {
                        Toast.makeText(MainActivity.this, "tu appartient a 
 la classe 1-3 ", Toast.LENGTH_LONG).show();
                    }
                //2eme caractere  c'est une lettre
            if(s2.equals("a") || s2.equals("b") || s2.equals("c")) {
                Toast.makeText(MainActivity.this, "tu appartient a la classe 
2-1 ", Toast.LENGTH_LONG).show();
            }
                else
            if(s2.equals("d") || s2.equals("e") || s2.equals("f")) {
                Toast.makeText(MainActivity.this, "tu appartient a la classe 
2-2 ", Toast.LENGTH_LONG).show();
            }
                //3eme caractere c'est un chiffre
                switch (s3)
                {
                    case 1:
                        Toast.makeText(MainActivity.this, "numero inferieur a la moyen", Toast.LENGTH_LONG).show();
                        break;
                    case 2:
                        Toast.makeText(MainActivity.this, "numero egal a la moyen", Toast.LENGTH_LONG).show();
                        break;
                    case 3:
                        Toast.makeText(MainActivity.this, "numero superieur a la moyen", Toast.LENGTH_LONG).show();
                        break;
                }
                //4eme et 5eme caractere
                if(s4.equals("aa") || s2.equals("bb") || s2.equals("cc")) {
                    Toast.makeText(MainActivity.this, "tu appartient a la classe XX ", Toast.LENGTH_LONG).show();
                }
                else
                    if (s4.equals("dd") || s2.equals("ee") || s2.equals("ff")) {
                        Toast.makeText(MainActivity.this, "tu appartient a la classe YY ", Toast.LENGTH_LONG).show();
                    }
                else
                    if (s4.equals("gg") || s2.equals("hh") || s2.equals("ii")) {
                        Toast.makeText(MainActivity.this, "tu appartient a la classe ZZ ", Toast.LENGTH_LONG).show();
                    }
    }
        });
    }
}
I have build the application and then when i open it with my phone and when i open the application and put some caractere in the EditText and then i push decode the application close
This is my code. I need help and thanks
 
    