Untitled
raw download clone
JAVASCRIPT
views 57
,
size 1130 b
package com.example.myapplication;




import androidx.appcompat.app.AppCompatActivity;




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




public class MainActivity extends AppCompatActivity {




    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    String text3;
    public void onClick1(View view)
    {
        EditText editText=(EditText) findViewById(R.id. editText);
        TextView textView2=(TextView) findViewById(R.id.textView2);




        int a =15;
        String text2;
        text2= editText. getText().toString();
        if(Integer.parseInt(text2)> a)
            text3 ="Меньше";
        else if (Integer.parseInt(text2)< a)
            text3 = "Больше";
        else if (Integer.parseInt(text2)== a)
            text3 = "Угадал";
        textView2.setText(text3);
    }
}
close fullscreen
Login or Register to edit or fork this paste. It's free.