package com.example.prime;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
public class MainActivity extends AppCompatActivity {
Button b1 , b2 , b3 , b4 ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_main);
Button b2 = findViewById(R.id.bt2);
Button b4 = findViewById(R.id.bt4);
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent si = new Intent(Intent.ACTION_SENDTO,Uri.parse(“smsto:1234567890”));
si.putExtra(“sms_body”, “Hello! This is a test message.”);
startActivity(si);
}
});
b4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent bi = new Intent(Intent.ACTION_VIEW);
bi.setData(Uri.parse(“https://www.google.com”));
startActivity(bi);
}
});
}
}