TOASTS AND CONTEXT - Android Fundamentals

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ • 94

  • @wavecycle
    @wavecycle 4 роки тому +50

    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 роки тому +9

      Wow thanks, that is a compliment, keep going! 🙏

    • @zareenwilhelm5811
      @zareenwilhelm5811 2 роки тому

      Lol me too - I can follow by just listening

  • @georgenady7375
    @georgenady7375 4 роки тому +17

    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

  • @V9ball
    @V9ball 3 роки тому +6

    Absolutely awesome series :). BTW, it looks like the "view" at 14:58 is deprecated now.

    • @brian_clips
      @brian_clips 3 роки тому +1

      did you solve this problem?

    • @dhruvmaindola673
      @dhruvmaindola673 2 роки тому +1

      @@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.

  • @matt-g-recovers
    @matt-g-recovers 3 роки тому +2

    Best explanation of Context in Android ever!

  • @cherylm8210
    @cherylm8210 4 роки тому +7

    Great video. None of the other videos i've seen mentioned custom toasts! It's new to me

  • @Amandeep-uc7qh
    @Amandeep-uc7qh 3 роки тому +4

    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💯

  • @akshaytati
    @akshaytati 3 роки тому +2

    Thanks man these tutorials are much better than the course i bought

  • @maresolaris
    @maresolaris 2 роки тому +1

    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!

  • @colbydowns2268
    @colbydowns2268 Рік тому +4

    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 Рік тому +1

      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 Рік тому

      @@kushagragoel6760 just type null in the place of clToast

    • @haamidmuhammad2633
      @haamidmuhammad2633 4 місяці тому

      @@sreeragvp4808 thanks for the tip. i'm wondering what exactly does null do though?

  • @guy1407
    @guy1407 4 роки тому +7

    I liked the screen trainsition of "imagine ..." :)
    Thanks a lot for your efforts!!!

  • @DBClipss
    @DBClipss Рік тому +1

    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 10 місяців тому

      View binding. Philipp has and video about it

  • @retodenis5181
    @retodenis5181 3 роки тому +2

    since api 30 setView is deprecated. Is any other easy way to set custom view for toast?

  • @sergiaguilar1
    @sergiaguilar1 3 роки тому +3

    view is deprecated how can I change that?

  • @muhammedrabee8234
    @muhammedrabee8234 3 роки тому +1

    It was very helpful , Good work man.

  • @loveshpurswani632
    @loveshpurswani632 3 роки тому +2

    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 роки тому +1

      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 роки тому +4

      @@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 2 роки тому

      @@chochosan044 Woah thanks mate. What does deprecated mean?

  • @rotimidokun
    @rotimidokun Рік тому +18

    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 Рік тому +1

      Thank you very very much!!!!!!!

    • @kskfernando2945
      @kskfernando2945 Рік тому

      Thanks a lot

    • @dhivakardhiva2963
      @dhivakardhiva2963 Рік тому

      thanks a lot brother

    • @fiedler65
      @fiedler65 Рік тому +3

      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()
      }
      }
      }
      }

  • @deli5777
    @deli5777 2 роки тому

    I like your videos. You are good at explaining things and you are easy to understand. Thanks

  • @chadzulu4328
    @chadzulu4328 3 роки тому +1

    Good ol' Mr. Poop! Another great video, thanks!

  • @walidaguib3944
    @walidaguib3944 Рік тому

    hi Philipp , why you do not use Relative Layout ?

  • @DevTipsForYou
    @DevTipsForYou 2 місяці тому

    This is why java is a lot better for learning, all those abstraction that you explain, you need to code in java.

  • @azmyin
    @azmyin 4 роки тому +1

    What would be the commands for the custom Toast in Java?

  • @hackingkingdom5634
    @hackingkingdom5634 2 роки тому

    Your videos really helpfull to understand the concepts .Thanku ❤

  • @javlontursunov6527
    @javlontursunov6527 2 роки тому +1

    Bro please make videos related to making an app which can connect to Nodemcu WiFi module

  • @juanclopgar97
    @juanclopgar97 2 місяці тому

    Is there a way to place a property to pass the text that the Toast is going to display?

  • @MohamedReda-bg8is
    @MohamedReda-bg8is 2 роки тому

    When I use the word "view" I see it written but crossed out. Does it have a newer version?

  • @alexgireff2180
    @alexgireff2180 3 роки тому

    Cool and clear as usual. Thanks🙏

  • @SuegroLM
    @SuegroLM 3 роки тому

    Superb

  • @nvalet
    @nvalet 4 роки тому

    Thank you for this amazing videos!

  • @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,

  • @karthicks1608
    @karthicks1608 4 роки тому

    How to toast an error in onError(). I can't get any context.

  • @riyazatkureshi1549
    @riyazatkureshi1549 3 роки тому

    How to set width of toast match parent?

    • @Jadestonk
      @Jadestonk 2 роки тому

      put match_parent on width xd

  • @amirayasmine8490
    @amirayasmine8490 2 роки тому

    you are amazing, thank you

  • @thahaziq97
    @thahaziq97 3 роки тому

    Thank you so much

  • @g3org3210
    @g3org3210 3 роки тому

    @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.

  • @guy1407
    @guy1407 4 роки тому +2

    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 роки тому +1

      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 роки тому +1

      i am having a similar issue

  • @danieladamiak8944
    @danieladamiak8944 Рік тому

    nice

  • @jacktolmie1971
    @jacktolmie1971 3 роки тому +1

    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...

  • @aaratprasadchopra3255
    @aaratprasadchopra3255 3 роки тому

    The custom toast is deprecated now I think

  • @lma_cristian
    @lma_cristian 3 роки тому

    Buen video

  • @billmolloy2264
    @billmolloy2264 Рік тому

  • @americancitizen748
    @americancitizen748 3 роки тому

    "Welcome, Mr. Poop!"

  • @SerhiiOr
    @SerhiiOr 4 роки тому

    BOMB!!!

  • @undefinedbug1.0
    @undefinedbug1.0 2 роки тому

    Perfect :)

  • @nanonkay5669
    @nanonkay5669 3 роки тому

    Did you just say Welcome Mr. Poop??? Lmao I wanna work with that guy now lol!!!!

  • @tessanix9771
    @tessanix9771 Рік тому

    Mr Poop has the bast name ever

  • @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

  • @Ilamarea
    @Ilamarea 2 роки тому

    Ahah! You are German! Eingabe betrayed you.

  • @KellyMalaki
    @KellyMalaki Рік тому

    Even though it looks pretty shitty😂😂😂

  • @alfian3570
    @alfian3570 4 роки тому +2

    Please add subtitle english

  • @ajaygalagali5963
    @ajaygalagali5963 4 роки тому

    :)

  • @Jojoyel
    @Jojoyel 4 роки тому +2

    Noooo Kotlin