package com.example.loginexample;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

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

    public void login(View view) {
        EditText username = findViewById(R.id.username);
        EditText password = findViewById(R.id.password);

        if(username.getText().toString().equals("admin") && password.getText().toString().equals("admin123")){
            Toast.makeText(this, "Uspesna prijava", Toast.LENGTH_SHORT).show();
        }
        else{
            Toast.makeText(this, "Losi podaci", Toast.LENGTH_SHORT).show();
        }
    }
}