Sunday, March 2, 2014

broadcastreceiver pass data to activity


broadcastreceiver pass to the activity monitor data such as how to get ah, I want to state the status of the phone returns with static activity in addition there are other ways to do
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Try intent pass data, you can bundle in intent, the data on the bundle inside.
Reply:
cited a floor sophia3377 reply:
with intent pass data to try, bundle can be placed in intent, the data on the bundle inside.
I am a broadcast to the activity in the transfer ah can not onreceive
Reply:
Nobody knows?
Reply:
reference to the second floor wenwei19861106 reply:
cited a floor sophia3377 reply: Try intent pass data, bundle intent can be placed in the data release In the bundle there. I am a broadcast to the activity can not be used in pass ah onreceive of

You use a broadcastreceiver receiving broadcast, then broadcastreceiver using intent to pass values ​​back also ok ah! Rao circle suddenly wears my own radio receiver to send yourself ah! Lz understand the problem.
Reply:
Register a broadcast receiver Activity, Action judge received broadcast if you want, and if that is the case, then the state judge.
Reply:
I say pass a value between recipients and activity than broadcast radio broadcast receivers to transmit data ah
Reply:
cited a floor sophia3377 reply:
with intent pass data to try, bundle can be placed in intent, the data on the bundle inside.


onRecieve startActivity in tone and intent to put the data inside.
Reply:
Dude you do not have the solution, how to solve, I would like to know how to get
Reply:
You add a broadcast in which a service, which monitor phone status. If you want a state, then sends a broadcast.
Then an internal activity inside a custom class that inherits from broadcastrecivier, this class has a rewriting method by intent.getAction () can get an action, if and broadcast service you sent me the same words, and then you can do whatever you want things
Reply:
Are Activity already exists?
If it is a start Activity, following methods can be used
Intent intent = new Intent (this, BroadcastClass);
intent.putExtra (name, value);
sendBroadcast (intent);
If it already exists, you can use the Handle pass parameters! ~
Reply:
Upstairs answer questions which are Activity brothers say in passing parameters to broadcastreceiver Alas
Reply:
reference to the 11th floor wenwei19861106 reply:
upstairs to answer the questions which are Activity brothers say in passing parameters to broadcastreceiver alas
< / fieldset>

Not to say it?
broadcastreceiver in onRecieve call startActivity, with the intent of the data transmission in the past, if it is singleTop of activity, you can use onNewIntent get the data, otherwise another Acitivty starts.

How do you want?
Reply:
references, 4th Floor sada09 reply:
Quote: references to the second floor wenwei19861106 reply:

Cited a floor sophia3377 reply: data transfer with intent to try, bundle intent can be placed inside, where the data on the bundle. I am a broadcast to the activity can not be used in pass ah onreceive of

You use a broadcastreceiver receiving broadcast, then broadcastreceiver using intent to pass values ​​back also ok ah! Rao circle suddenly wears my own radio receiver to send yourself ah! Lz understand the problem.



The landlord did not mean the same Activity pass data between multiple Activity pass data through BroadcastReceiver, like saying I have an Activity A and Activity B, A is a display interface information, such as file size download Ah Ah, I'm in A Click the download button to download this file to the list (can not jump directly to B, the desired effect as the android market to download files that), Class B is the download list, you need to download this update progress, progress bar so refreshing, Receiver of A transfer can receive the download progress over the data, but how to pass the data to B it? ? ?
Reply:

Reply:
Your landlord now it? Teach me A

No comments:

Post a Comment