Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.LinuxKidEX.service;
- import android.app.Activity;
- import android.os.Bundle;
- import android.app.PendingIntent;
- import android.content.BroadcastReceiver;
- import android.content.Context;
- import android.content.Intent;
- import android.content.IntentFilter;
- import android.telephony.SmsManager;
- import android.widget.Button;
- import android.widget.EditText;
- import android.view.KeyEvent;
- import android.view.View;
- import android.widget.Toast;
- public class serv extends Activity
- implements View.OnKeyListener, View.OnClickListener{
- Button sendBtn;
- EditText phoneFld;
- EditText msgFld;
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- sendBtn = (Button)findViewById(R.id.sendBtn);
- sendBtn.setOnClickListener(this);
- phoneFld = (EditText)findViewById(R.id.numFld);
- phoneFld.setOnKeyListener(this);
- msgFld = (EditText)findViewById(R.id.msgFld);
- msgFld.setOnKeyListener(this);
- }
- @Override
- public boolean onKey(View v, int keyCode, KeyEvent event) {
- // TODO Auto-generated method stub
- return false;
- }
- @Override
- public void onClick(View v) {
- String phoneNum = phoneFld.getText().toString();
- String msg = msgFld.getText().toString();
- Intent servInt = new Intent(this, smsserv.class);
- servInt.putExtra("MSG", msg);
- servInt.putExtra("NUM", phoneNum);
- startService(servInt);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement