Home > Mobile >  Android doesn't receive broadcast
Android doesn't receive broadcast

Time:10-13

Radio not receive, send it, accept it also, but is not received, what can I do?
This is to send:
Intent intent=new Intent();
Mainac intent. SetAction (" ");
Intent. SetType (" more ")
Context. SendBroadcast (intent);
Accept:
MyBroadcastReciver=new myBroadcastReciver ();
IntentFilter filter=new IntentFilter ();
Mainac filter. AddAction (" ");
RegisterReceiver (myBroadcastReciver, filter);


Private class MyBroadcastReciver extends BroadcastReceiver {

@ Override
Public void onReceive (Context Context, Intent Intent) {
The log ("==========received radio============");
Toast (got broadcast "============");
If (intent. GetAction (). The equals (BroadType)) {
String type=intent. GetStringExtra (" type ");
If (" market ". The equals (type)) {//task
Dots [0]. SetVisibility (the VISIBLE).
} else if (" sell ". The equals (type)) {//sales
Dots [1]. SetVisibility (the VISIBLE).
} else if (" train ". The equals (type)) {//training
Dots [3]. SetVisibility (the VISIBLE).
} else if (" client ". The equals (type)) {//customer
Dots [2]. SetVisibility (the VISIBLE).
} else if (" more ". The equals (type)) {//more
Dots [4]. SetVisibility (the VISIBLE).
}
}
}
}

But the result is received less than, online to find a lot of method, the result is failed,
Is suddenly thought concerned with the intent of setting the type value, so comment out the type value, radio can be received, as to why such, the great god to find reasons to go!

CodePudding user response:

Thank you for your prompt, pick up points,

CodePudding user response:

I see you online ah, continue to delete, you also is 6

CodePudding user response:

Still not quick to find the reason

CodePudding user response:

The IT environment, wang is really sweet

CodePudding user response:

The more you is a what consciousness

CodePudding user response:

Island that man running for several weeks before I learn skills blog said I not jing, I asked him what is multiple database, which is the somebody else, he doesn't answer, words full of puzzling superiority, in the words said later called me to his blog under scold him, said that this behavior is childish, and then to prohibit comments on blogs, oneself ran and scolded me beneath my blog blog, these actions show my scalp pins and needles, intelligence and moral, that have no brain show lower limit of people pass by don't miss you passed by
  • Related