handling broadcast reciver
<p>I have an app which has MainActivity(without gui.. please just flow with it:) )</p>

<p>now this MainActivity running a service, this service using sendBroadcast() in order to comunnicate with the MainActivity..
now ofcourse i need to <strong>registerReceiver</strong> in the <strong>onResume</strong>() of the MainActivity.</p>

<p>but i also need to add <strong>unregisterReceiver</strong>(receiver) in the <strong>onDestroy</strong>() of the MainActivity.</p>

<p>problem is: when i first start that app i need it to up the service, and i dont want the user to lose focus, so i press <strong>finish</strong>() after i`am starting the service.. but then auto invoked also 
unregisterReceiver(receiver).. and this is not good for me.. i get error it's said it couldnt find any registerd reciver.</p>

<p>so i fixed it by delete this line.. but i am sure its going to 'revenege' me in the future, when/where could i have problem if i wont use unregisterReceiver(receiver)..  at the onDestroy()</p>

<p>mybe i should remove it (instead of delete it) to onPause()?</p>

<p>thanks,</p>

<p>ray.</p>
