How to show /save receive message in text box

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

How to show /save receive message in text box

Postby basit bilal » Wed Jul 28, 2010 11:05 am

can any one help me how to show/store receive msg in text box.

I have wright the code but receive msg show on the top of the emulator screen .

package net.learn2develop.SMSMessaging;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;

import android.provider.MediaStore;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import android.util.Log;

public class SMSReceiver extends BroadcastReceiver {

String txtEncryptedMessage ;
public SMSReceiver(String passedView)
//String incoming_SMS =

public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();

Object messages[] = (Object[]) bundle.get("pdus");
SmsMessage smsMessage[] = new SmsMessage[messages.length];
for (int n = 0; n< messages.length; n++)
smsMessage[n] = SmsMessage.createFromPdu((byte[]) messages[n]);
/* Logger Debug-Output */
Log.i(txtEncryptedMessage, "[SMSApp] onReceiveIntent: " + txtEncryptedMessage);
// show first message
Toast toast = Toast.makeText(context,"Received SMS: " + smsMessage[0].getMessageBody(), Toast.LENGTH_LONG);;

///String message=smsMessage.toString();
// txtEncryptedMessage=toast.toString();
/// txtEncryptedMessage=(View) findViewById(;

Plz help me to solve my problem
basit bilal
Posts: 3
Joined: Wed Jul 28, 2010 8:03 am


Return to General

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests