import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity {
EditText e1,e2,e3;
Button b;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
e1=findViewById(R.id.n1);
e2=findViewById(R.id.n2);
e3=findViewById(R.id.n3);
b=findViewById(R.id.b1);
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i= new Intent(MainActivity.this,MainActivity2.class);
int r =Integer.parseInt(e1.getText().toString());
int g =Integer.parseInt(e2.getText().toString());
int b =Integer.parseInt(e3.getText().toString());
i.putExtra("red",r);
i.putExtra("green",g);
i.putExtra("blue",b);
startActivity(i);
}
});
}
}