Note that there are some explanatory texts on larger screens.

plurals
  1. POTIME_TICK action not calling broadcast receiver
    primarykey
    data
    text
    <p>I have written a simple broadcast receiver responding to <code>TIME_TICK</code> action .</p> <p>When I add the action in the manifest file it is not calling the registered receiver but when I register the receiver in the java code it is being called. I have a simple <strong>onreceive</strong> method.</p> <pre><code>public class mybroad extends BroadcastReceiver { @Override public void onReceive(Context arg0, Intent arg1) { // TODO Auto-generated method stub Log.v("got", "broadcasted"); Toast.makeText(arg0, "hurray broadcast got", Toast.LENGTH_LONG).show(); } } </code></pre> <p>receiver tag for manifest file</p> <pre><code>&lt;receiver android:name="com.example.chapbasic.mybroad" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.TIME_TICK"&gt;&lt;/action&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; </code></pre> <p>when I operate with the following code it is working</p> <pre><code>public class broadact extends Activity { IntentFilter ii; mybroad mb; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.mybroad); ii=new IntentFilter("android.intent.action.TIME_TICK"); mb=new mybroad(); } @Override protected void onResume() { // TODO Auto-generated method stub super.onResume(); registerReceiver(mb, ii); } @Override protected void onPause() { // TODO Auto-generated method stub super.onPause(); unregisterReceiver(mb); } </code></pre> <p>Kindly update why it is not being called from the manifest file registration. thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload