Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.hstu.callmsgemail;
- import android.content.Intent;
- import android.net.Uri;
- import android.provider.Telephony;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- public class MainActivity extends AppCompatActivity {
- private Button email,msg,call;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- email = (Button)findViewById(R.id.emailID);
- msg = (Button)findViewById(R.id.msgID);
- email = (Button)findViewById(R.id.callID);
- call.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- String phone = "01791810207";
- Intent intent = new Intent(Intent.ACTION_DIAL, Uri.fromParts("tel",phone,null));
- startActivities(intent);
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment