Saturday, July 27, 2024
HomePHPAndroid Intent-filters - PHPGurukul

Android Intent-filters – PHPGurukul


bundle com.instance.intentfilter;

 

import androidx.appcompat.app.AppCompatActivity;

 

import android.content material.Intent;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;

import android.widget.RadioButton;

 

public class MainActivity extends AppCompatActivity {

    RadioButton radioButton;

 

    @Override

    protected void onCreate(Bundle savedInstanceState) {

        tremendous.onCreate(savedInstanceState);

        setContentView(R.structure.activity_main);

        ultimate Button button = findViewById(R.id.buton);

        button.setOnClickListener(new View.OnClickListener() {

            @Override

            public void onClick(View v) {

                Intent intent = new Intent(Intent.ACTION_SEND);

                intent.setType(“message/rfc822”);

                intent.putExtra(Intent.EXTRA_EMAIL, new String[]{“contact@tutorialspoint.com”});

                intent.putExtra(Intent.EXTRA_SUBJECT, “Welcome to tutorialspoint.com”);

                startActivity(Intent.createChooser(intent, “Select default Mail App”));

            }

        });

    }

}

 

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments