Forums Register Login

how to filter broadcastreceiver

+Pie Number of slices to send: Send
I have a broadcastreceiver in my project.It always run when SMS received.When i get SMS my app starts to run.But i need to filter SMS and for specific SMS i need to run the app.How to do this ?
+Pie Number of slices to send: Send
The filtering would be done by the app. If nothing needs to be done, just quit the app, and the user will never know.
+Pie Number of slices to send: Send
how to stop the app?
+Pie Number of slices to send: Send
I called another class in my Broadcast receiver class.So i can't use Finish() method,as main activity is already onpause.So how can i close all open activities ?
in my case i have two open activities.
+Pie Number of slices to send: Send
I thought the point was just to show some dialog to the user? Surely it's not necessary to have two activities for that. And if the SMS shouldn't trigger the dialog, there is no need for any activity to be run.
+Pie Number of slices to send: Send
I am developing app for special sms.So my requirment if if user received that type of sms i need to do something.else if i received sms i don't need to run the app.Currently i am checking the sms in activity x,but its not main activity.When sms received Broadcast receiver run and called that x activity. If the sms is not required one i can finish x activity,but main activity still there.So how to solve this problem.Shall i call main activity in my broadcast receiver ? or is there a another way to close both x activity and main activity ?
+Pie Number of slices to send: Send
I don't understand why you're starting any activity at all. Why can't the decision of whether or not to do something with the SMS be made in the receiver?

And even if you need to start the "x" activity, why would the main activity be started at all?
+Pie Number of slices to send: Send
main activity starts automatically.can we stop it ?if so shall we remove that part from manifest file?
+Pie Number of slices to send: Send
This is my main class



this is my manifest file


this is my broadcast receiver



I am checking whose sending the message now in broadcastreceiver.But if another one sends a meesage it gives me error


I debug the code ,but it doesn't give any exception,it ends normally.After debug finished the it gives above message.
Blood pressure normal? What do I change to get "magnificent"? Maybe this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1788 times.
Similar Threads
filter incoming sms android by phone no
Activity Expired Time Out From BroadcastReceiver (need ASAP solution)
Application not run in the background
What Am I Missing About Android Services?
Running Services immediately after the apk is installed on the device.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 22:14:04.