Good explanation. I like that you pause before "code" and add code line by line in the logical order, i.e. add the intentFilter after you started explaining registerReceiver().
Hey... Thanks for noticing these subtleties.. these are well thought through and it feels good when some one appreciates these things. Please visit the play list section of the channel to see other content. Hope you have subscribed.
Thanks for all the tutorial you have made, they are all great and easy to understand. I wish you can make a tutorial about Design Pattern in android (MVP, MVVM) or Clean architecture in the future.
I am not sure whether I understood the question correctly. But if you mean to ask whether Broadcast Receiver can trigger an Activity, regardless of whether it is in foreground and background, then the answer is yes.
Please visit the playlist section of the channel to see other Android series that are already out there on channel. Hope you will find something useful and of interest to you.
sir how can we send custm broadcast from service e.g Intent i= new Intent(); i.addCategory(Intent.CATEGORY_DEFAULT); i.setAction("com.s.make.call"); i.putExtra("pho","hi"); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); sendBroadcast(i); i try this but getting nullpointe exception please help me in this sir
It's very difficult yo guess what's happening here by just looking at the small snippet of code. For example why are you trying to triggering a Broadcast Receiver from a Service (standard practice is usually reverse). Also you are using Intent.FLAG_ACTIVITY_NEW_TASK with Intents, which are typically used with Activity (Not Service or Broadcast Receiver) It says there is a null pointer exception. Null pointer exceptions are probably most easiest to debug. Did you debug the app?
no.. nothing related to priority.. Please check the code again. The source code is present below the video in description section. Also check the target version of the app. Verify the manifest and build.gradle file is correctly configured.
I suggest you completely go through the Broadcast Receiver series on Codetutor. Your doubts will be resolved. Look out for comment section. Some one (including me) might have already addressed this as a reply on similar sounding questions.
onStop() is not guaranteed to get called, thus your BroadcastReceiver will not be unregistered. Instead register in onResume() and unregister in oPause().
You are right. The possibility of onStop not getting called is very remote and happens when resource crunch happens. For simple demo purpose I have ignored this. My Idea is to register the BR when Activity becomes visible and unregister when activity is going invisible. onStop and and onStop and the call back methods for these respectively. When activity becomes partially invisible - say when with a dialog box - then only onPause is called and onStop is not called. I don't want my BR to unregister when Activity is partially invisible - that is why I am unregistering it in onStop. However you can utilize onResume and onPause for this. More of activity life cycle is here - th-cam.com/video/T88qoVIHaKc/w-d-xo.html.
Some day I will make a video on that as well... as of now I am mainly concentrating on basic fundamentals in Android development.. Thanks for suggesting..
Can you elaborate! As per the documentation (developer.android.com/reference/android/provider/Telephony) API is still not deprecated. It's relatively a new API (Introduced in API-19).
Quite honest comment.. and I would agree too.. 😆😆. It has been quite long time since I have done something about it. Let me assure you, I will change it ASAP. Thanks for commenting.
Good explanation. I like that you pause before "code" and add code line by line in the logical order, i.e. add the intentFilter after you started explaining registerReceiver().
Hey... Thanks for noticing these subtleties.. these are well thought through and it feels good when some one appreciates these things. Please visit the play list section of the channel to see other content. Hope you have subscribed.
Thanks for all the tutorial you have made, they are all great and easy to understand.
I wish you can make a tutorial about Design Pattern in android (MVP, MVVM) or Clean architecture in the future.
+Allan Pana Stay tuned.. The topics that you have suggested is definitely on cards... Hope you have subscribed..
sir this is for one activity what if i want to fire broadcast receiver when my activity is open means it is in foreground or on background.
I am not sure whether I understood the question correctly. But if you mean to ask whether Broadcast Receiver can trigger an Activity, regardless of whether it is in foreground and background, then the answer is yes.
Awesome series . . . expecting more videos like this
Please visit the playlist section of the channel to see other Android series that are already out there on channel. Hope you will find something useful and of interest to you.
sir how can we send custm broadcast from service
e.g Intent i= new Intent();
i.addCategory(Intent.CATEGORY_DEFAULT);
i.setAction("com.s.make.call");
i.putExtra("pho","hi");
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
sendBroadcast(i);
i try this but getting nullpointe exception
please help me in this sir
It's very difficult yo guess what's happening here by just looking at the small snippet of code. For example why are you trying to triggering a Broadcast Receiver from a Service (standard practice is usually reverse). Also you are using Intent.FLAG_ACTIVITY_NEW_TASK with Intents, which are typically used with Activity (Not Service or Broadcast Receiver) It says there is a null pointer exception. Null pointer exceptions are probably most easiest to debug. Did you debug the app?
yes sir
I'm not getting the toast message. Something to do with the priority?
no.. nothing related to priority.. Please check the code again. The source code is present below the video in description section. Also check the target version of the app. Verify the manifest and build.gradle file is correctly configured.
Thanks sir but i have problem , Toast message not showing , what do we i need to correct this issue.
I suggest you completely go through the Broadcast Receiver series on Codetutor. Your doubts will be resolved. Look out for comment section. Some one (including me) might have already addressed this as a reply on similar sounding questions.
onStop() is not guaranteed to get called, thus your BroadcastReceiver will not be unregistered. Instead register in onResume() and unregister in oPause().
You are right. The possibility of onStop not getting called is very remote and happens when resource crunch happens. For simple demo purpose I have ignored this. My Idea is to register the BR when Activity becomes visible and unregister when activity is going invisible. onStop and and onStop and the call back methods for these respectively. When activity becomes partially invisible - say when with a dialog box - then only onPause is called and onStop is not called. I don't want my BR to unregister when Activity is partially invisible - that is why I am unregistering it in onStop. However you can utilize onResume and onPause for this. More of activity life cycle is here - th-cam.com/video/T88qoVIHaKc/w-d-xo.html.
Nice tutorial along with good fundamental..
very good and simple explanation, helpful for me.
i am not getting toast message .... i did everything exactly same
It's issue with target version of the app. Please go through the comment section. This issue has been addressed before.
Can you please upload the android push notification tutorial with fundamental way.if possible
Some day I will make a video on that as well... as of now I am mainly concentrating on basic fundamentals in Android development.. Thanks for suggesting..
Namastae Sir Getting problem onReceive Method in BroadCastReceiver Toast Message is not showing using android 3.6.3 and api level 16 minsdk 29
public class MyBroadCastRecev extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
Log.i("TAG", "BROAD");
Toast.makeText(context,"BroadCast Recv trip",Toast.LENGTH_LONG).show();
}
}
khatarnaak thanx
Man I fucking love you. I was searching for this kind of solution since today in the morning. Thanks
+KnowledgeBase hahaha..Thanks... Visit the playlist section of the channel to see which other concepts are discussed. Hope you have subscribed.
very informative
Thanks.. really appreciate it. If you like some content share it with our friends who might find it useful. Help spread the word about channel.
No android.provider.Telephony
Can you elaborate! As per the documentation (developer.android.com/reference/android/provider/Telephony) API is still not deprecated. It's relatively a new API (Introduced in API-19).
Awesome
Thanks.. Feel free to visit playlist section of the channel to check out other content on Android. Hope you have subscribed.
tqq soo much
the worst thing in your videos is introduction :)
Quite honest comment.. and I would agree too.. 😆😆. It has been quite long time since I have done something about it. Let me assure you, I will change it ASAP. Thanks for commenting.
@@Codetutor-DemystifyCoding
I wish you the best of luck, I benefit from you a lot. You are a great person :)