TOASTS AND CONTEXT - Android Fundamentals

  Рет қаралды 38,305

Philipp Lackner

Philipp Lackner

Күн бұрын

In this video you will learn about the context in Android an how to use it to display a little toast message.
⭐ Get certificates for your future job
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:
pl-coding.com/...
Regular Android tutorials on my Instagram: / philipplackner_official
Checkout my GitHub: github.com/phi...

Пікірлер: 94
@wavecycle
@wavecycle 4 жыл бұрын
This is very well done, thank you. I'm disabled and can only spend a limited time staring at a screen, and your explanations are clear enough that I can mostly follow just using audio!
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Wow thanks, that is a compliment, keep going! 🙏
@zareenwilhelm5811
@zareenwilhelm5811 2 жыл бұрын
Lol me too - I can follow by just listening
@georgenady7375
@georgenady7375 4 жыл бұрын
I am George From Egypt really I wana tell you something .. you are learn the content in very detailed and this is the point for the beginners you are awesome good job and you will be something great soon
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Thank you man that's a great feedback ❤️
@georgenady7375
@georgenady7375 4 жыл бұрын
@@PhilippLackner you deserve it
@Amandeep-uc7qh
@Amandeep-uc7qh 3 жыл бұрын
I watch your videos even if I knew how to do that thing because you really teach all the small concepts which helps me to understand them better💯
@cherylm8210
@cherylm8210 4 жыл бұрын
Great video. None of the other videos i've seen mentioned custom toasts! It's new to me
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Thank you! I'm glad it helps you
@matt-g-recovers
@matt-g-recovers 3 жыл бұрын
Best explanation of Context in Android ever!
@V9ball
@V9ball 3 жыл бұрын
Absolutely awesome series :). BTW, it looks like the "view" at 14:58 is deprecated now.
@brian_clips
@brian_clips 3 жыл бұрын
did you solve this problem?
@dhruvmaindola673
@dhruvmaindola673 2 жыл бұрын
@@brian_clips its not a problem. One can still use it for now. There must be some new implementation of it that must be getting recommended although im not entirely sure.
@akshaytati
@akshaytati 3 жыл бұрын
Thanks man these tutorials are much better than the course i bought
@maresolaris
@maresolaris 2 жыл бұрын
What an excellent tutorial, with excellent hints on HOW to use these methods and techniques without sounding hurried. Thank you for putting in your efforts. You gained a fan!
@guy1407
@guy1407 4 жыл бұрын
I liked the screen trainsition of "imagine ..." :) Thanks a lot for your efforts!!!
@GrumpyOldMan9
@GrumpyOldMan9 3 жыл бұрын
This German accent is much easier on the ear than that of "Coding In Flow"
@deli5777
@deli5777 2 жыл бұрын
I like your videos. You are good at explaining things and you are easy to understand. Thanks
@muhammedrabee8234
@muhammedrabee8234 3 жыл бұрын
It was very helpful , Good work man.
@hackingkingdom5634
@hackingkingdom5634 Жыл бұрын
Your videos really helpfull to understand the concepts .Thanku ❤
@DevTipsForYou
@DevTipsForYou 7 күн бұрын
This is why java is a lot better for learning, all those abstraction that you explain, you need to code in java.
@chadzulu4328
@chadzulu4328 2 жыл бұрын
Good ol' Mr. Poop! Another great video, thanks!
@sergiaguilar1
@sergiaguilar1 3 жыл бұрын
view is deprecated how can I change that?
@rotimidokun
@rotimidokun Жыл бұрын
Some processes in this video are deprecated. If you want to complete a custom toast, see my code: class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding private var customToastView: View? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) //bind your parent xml layout with view binding binding = ActivityMainBinding.inflate(layoutInflater) setContentView(binding.root) //inflate your custom toast xml file customToastView = layoutInflater.inflate( R.layout.custom_toast, findViewById(R.id.csToastContainer) as ViewGroup? ) binding.btnShowToast.setOnClickListener { val toast = Toast(this@MainActivity) toast.duration = Toast.LENGTH_LONG toast.setGravity(Gravity.BOTTOM, 0, 200) toast.view = customToastView toast.show() } } }
@kluster120
@kluster120 Жыл бұрын
Thanky you bro !)
@sadiqusman2965
@sadiqusman2965 Жыл бұрын
Thank you very very much!!!!!!!
@kskfernando2945
@kskfernando2945 Жыл бұрын
Thanks a lot
@dhivakardhiva2963
@dhivakardhiva2963 Жыл бұрын
thanks a lot brother
@fiedler65
@fiedler65 Жыл бұрын
To me using findViewById does not look like a natural solution. This is what I would suggest. class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) setContentView(binding.root) binding.btnShowToast.setOnClickListener { Toast(this).apply { duration = Toast.LENGTH_LONG view = CustomToastBinding.inflate(layoutInflater).root show() } } } }
@colbydowns2268
@colbydowns2268 Жыл бұрын
Hey Philipp, I think the layoutInflater has undergone some changes in recent years. The custom toast portion of this video doesn't appear to work anymore if coded in Android today. I'm currently working through the playlist. I expect some hiccups from a 3 year old series... just wanted you to know. Thanks!
@kushagragoel6760
@kushagragoel6760 Жыл бұрын
+1 I was getting an error too, did you solve it?
@Homo_Samiens
@Homo_Samiens 11 ай бұрын
This Series is based in 2020 and yes some things are not relevant in 2023, Try following his "Android Basics 2023" hope you will find the latest tools in that playlist!
@sreeragvp4808
@sreeragvp4808 10 ай бұрын
@@kushagragoel6760 just type null in the place of clToast
@haamidmuhammad2633
@haamidmuhammad2633 Ай бұрын
@@sreeragvp4808 thanks for the tip. i'm wondering what exactly does null do though?
@alexgireff2180
@alexgireff2180 2 жыл бұрын
Cool and clear as usual. Thanks🙏
@javlontursunov6527
@javlontursunov6527 Жыл бұрын
Bro please make videos related to making an app which can connect to Nodemcu WiFi module
@retodenis5181
@retodenis5181 2 жыл бұрын
since api 30 setView is deprecated. Is any other easy way to set custom view for toast?
@linox20
@linox20 2 жыл бұрын
friend your videos are marvellous, maybe you settled your language for german because, i can read english but i cannot listen and when i use the subtitles youtube offer me german translation,
@nvalet
@nvalet 3 жыл бұрын
Thank you for this amazing videos!
@PhilippLackner
@PhilippLackner 3 жыл бұрын
Thanks for watching!
@walidaguib3944
@walidaguib3944 Жыл бұрын
hi Philipp , why you do not use Relative Layout ?
@azmyin
@azmyin 3 жыл бұрын
What would be the commands for the custom Toast in Java?
@SuegroLM
@SuegroLM 3 жыл бұрын
Superb
@amirayasmine8490
@amirayasmine8490 2 жыл бұрын
you are amazing, thank you
@DBClipss
@DBClipss 10 ай бұрын
i have having trouble with the custom toast. When i try to create view in line 18, it doesnt allows me to select the root id and there a dash in the view text aswell. i think its probably cause of version or that this method is deprecated. What should i do for this?
@Klusio19
@Klusio19 7 ай бұрын
View binding. Philipp has and video about it
@thahaziq97
@thahaziq97 3 жыл бұрын
Thank you so much
@danieladamiak8944
@danieladamiak8944 10 ай бұрын
nice
@loveshpurswani632
@loveshpurswani632 3 жыл бұрын
Hey Phillip, I did the same thind as you did but the clToast ID that you gave in the layoutInflater Statement is hilighted as red and showing error: Unresolved reference. Please can you help me with that
@SuegroLM
@SuegroLM 3 жыл бұрын
Did you import kotlinx.android.Synthetic.* (or something like that)? If not, then probably you're getting the error because this kotlinx plugin's feature has been deprecated for a while now, if you want to reference your viewID you can either get it with findViewById (Which I'd not recommend, probably only for some rare cases) or ViewBinding which is a feature from the AndroidX Jetpack library that I recommend.
@trevorPhillips284
@trevorPhillips284 2 жыл бұрын
i am having the same error as well
@chochosan044
@chochosan044 2 жыл бұрын
@@trevorPhillips284 you have to use viewbinding, since synthetics are deprecated, and you already have ActivityMainBinding for the main activity xml you have to setup another one for custom toast, import ......CustomToastBinding, then in class MainActivity declare private lateinit var binding1 (or smth else since binding is already taken) : CustomToastBinding then use binding1.clToast in the inflater ...
@TheImaginativeSachin
@TheImaginativeSachin Жыл бұрын
@@chochosan044 Woah thanks mate. What does deprecated mean?
@g3org3210
@g3org3210 2 жыл бұрын
@Philipp - > " 'setter for view: View?' is deprecated. Deprecated in Java. " Any chance in still doing custom toasts with the latest Kotlin implementation?! Later EDIT: It seems to be working fine, just throws a warning.
@billmolloy2264
@billmolloy2264 11 ай бұрын
@MohamedReda-bg8is
@MohamedReda-bg8is 2 жыл бұрын
When I use the word "view" I see it written but crossed out. Does it have a newer version?
@nanonkay5669
@nanonkay5669 2 жыл бұрын
Did you just say Welcome Mr. Poop??? Lmao I wanna work with that guy now lol!!!!
@undefinedbug1.0
@undefinedbug1.0 Жыл бұрын
Perfect :)
@lma_cristian
@lma_cristian 3 жыл бұрын
Buen video
@aaratprasadchopra3255
@aaratprasadchopra3255 3 жыл бұрын
The custom toast is deprecated now I think
@americancitizen748
@americancitizen748 3 жыл бұрын
"Welcome, Mr. Poop!"
@noso22ji
@noso22ji 3 жыл бұрын
😂😂
@mrak7588
@mrak7588 2 жыл бұрын
😂😂
@karthicks1608
@karthicks1608 3 жыл бұрын
How to toast an error in onError(). I can't get any context.
@SerhiiOr
@SerhiiOr 4 жыл бұрын
BOMB!!!
@PhilippLackner
@PhilippLackner 4 жыл бұрын
NSA wants to know your location
@jacktolmie1971
@jacktolmie1971 3 жыл бұрын
Skip the part when he is making the custom Toast. It is depreciated, and will not work.
@jacktolmie1971
@jacktolmie1971 3 жыл бұрын
​@Lahty V. I think .makeText() is the new way: kotlin-android.com/android-toast-kotlin/ I am still learning this myself, so hopefully this is right...
@riyazatkureshi1549
@riyazatkureshi1549 3 жыл бұрын
How to set width of toast match parent?
@ManeelxAkosAdor
@ManeelxAkosAdor 2 жыл бұрын
put match_parent on width xd
@tessanix9771
@tessanix9771 Жыл бұрын
Mr Poop has the bast name ever
@guy1407
@guy1407 4 жыл бұрын
Hi, I have a problem with the custom toast. The view variable has a strike line, and the error is : Unresolved reference: inflate
@guy1407
@guy1407 4 жыл бұрын
setter for view: View?' is deprecated. Deprecated in Java
@brian_clips
@brian_clips 3 жыл бұрын
hey, did you solve this problem?
@guy1407
@guy1407 3 жыл бұрын
No...
@brian_clips
@brian_clips 3 жыл бұрын
@@guy1407 it's so bad, but thanks
@trevorPhillips284
@trevorPhillips284 2 жыл бұрын
i am having a similar issue
@alfian3570
@alfian3570 3 жыл бұрын
Please add subtitle english
@Ilamarea
@Ilamarea 2 жыл бұрын
Ahah! You are German! Eingabe betrayed you.
@KellyMalaki
@KellyMalaki Жыл бұрын
Even though it looks pretty shitty😂😂😂
@ajaygalagali5963
@ajaygalagali5963 4 жыл бұрын
:)
@guy1407
@guy1407 4 жыл бұрын
How can I send you a private message please ?
@PhilippLackner
@PhilippLackner 4 жыл бұрын
on my instagram
@guy1407
@guy1407 4 жыл бұрын
@@PhilippLackner Look there for a PM please
@Jojoyel
@Jojoyel 4 жыл бұрын
Noooo Kotlin
INTENTS AND STARTING ACTIVITIES - Android Fundamentals
16:11
Philipp Lackner
Рет қаралды 68 М.
What is the Context? - Android Basics 2023
11:22
Philipp Lackner
Рет қаралды 58 М.
ДЕНЬ УЧИТЕЛЯ В ШКОЛЕ
01:00
SIDELNIKOVVV
Рет қаралды 3,1 МЛН
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 120 МЛН
Spongebob ate Patrick 😱 #meme #spongebob #gmod
00:15
Mr. LoLo
Рет қаралды 20 МЛН
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 1,6 МЛН
Kotlin Context Receivers - How to Use, Why, and Best Practice
24:22
Rock the JVM
Рет қаралды 4,7 М.
TEXTVIEWS - Android Fundamentals
14:09
Philipp Lackner
Рет қаралды 27 М.
CHECKBOX AND RADIOBUTTON - Android Fundamentals
16:01
Philipp Lackner
Рет қаралды 30 М.
PASSING DATA BETWEEN ACTIVITIES - Android Fundamentals
18:44
Philipp Lackner
Рет қаралды 46 М.
Context in Android - A Deep Dive
12:39
Konstantinos Reppas
Рет қаралды 5 М.
LAYOUT BASICS AND LINEAR LAYOUT - Android Fundamentals
16:45
Philipp Lackner
Рет қаралды 119 М.
The Android Context, the Manifest, and the Android System
35:28
Ioannis Anifantakis
Рет қаралды 2,7 М.
The Value of Source Code
17:46
Philomatics
Рет қаралды 50 М.
ACTIVITIES AND LIFECYCLE - Android Fundamentals
9:46
Philipp Lackner
Рет қаралды 67 М.
ДЕНЬ УЧИТЕЛЯ В ШКОЛЕ
01:00
SIDELNIKOVVV
Рет қаралды 3,1 МЛН