Android : Android,Broadcast Receivers activity class wait if its already running

on Saturday, August 9, 2014


I have an activity class which is called on receiving SMS. Inside of that activity,I call another activity and perform some required actions.



public class SMSReceiver extends BroadcastReceiver {

// Get the object of SmsManager
final SmsManager sms = SmsManager.getDefault();
public static boolean wasScreenOn = true;
Context context;

public void onReceive(Context context, Intent intent) {
this.context = context;
// Intent intent = new Intent();
// starting activity and performing some other action
}

}


// part of AndroidManifest.xml

<receiver android:name="com.**************.********.SMSReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>


Problem I am facing is while I am in 2nd activity class and meanwhile I received another message then 2nd activity class is never called for 2nd SMS.


I am new in android and on stackoverflow as well. Sorry If I didn't follow rule (at least I follow 1 rule that I searched throughly for answer before asking this question) or if I fail in asking question properly


0 comments:

Post a Comment