Тёмный
No video :(

Dialog Fragment to Fragment 

CodingWithMitch
Подписаться 145 тыс.
Просмотров 49 тыс.
50% 1

Опубликовано:

 

26 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 83   
@zrvnavi23
@zrvnavi23 Год назад
Literally a life saver 4 years later. Clearest way to do this. Cheers!
@yurco
@yurco 4 года назад
Thank you. In almost every website people say that is impossible. And you make it seems so easy.
@joaovitorsilveirabranco8855
@joaovitorsilveirabranco8855 4 года назад
Thank you very much, I'm developing my app and I didn't know how I used dialogs within fragments, but you gave me a great help. I am Brazilian and here it is difficult to find good videos on android.
@rodneyperello
@rodneyperello 2 года назад
Finally! Something simple, correct, and succinct! Thank you Sir.
@FarooqAhmad-lr1fx
@FarooqAhmad-lr1fx 2 года назад
Useful. In fact, all your toturial came useful to me. thanks
@kanskejonasidag1
@kanskejonasidag1 6 лет назад
The reason why it wouldn't work with v4 fragment might be that for it to work you need to use getSupportFragmentManager() I think. And also, extend FragmentActivity.
@user735_
@user735_ 4 года назад
Thanks, my crashing app was fixed thanks to this.
@javaddehghan8737
@javaddehghan8737 4 года назад
many thanks. that was very very good.i search a lot and i was hopeless from answer
@akshunkc6884
@akshunkc6884 5 лет назад
great video saved me from great deal of trouble ... thank u very much
@vikasverma3453
@vikasverma3453 4 года назад
Thanks a lot Mitch... it is very helpful to understand the subject concept.
@ibrahimhossam7985
@ibrahimhossam7985 2 года назад
Thank you so much bro ... you are great
@roxinol4690
@roxinol4690 5 лет назад
Hi, when I click the button I have this error. java.lang.NullPointerException: Attempt to invoke virtual method 'void com.ola.ricardo.ola2.MainFragment.sendInput(java.lang.String)' on a null object reference How can I resolve this?
@fergferg44
@fergferg44 3 года назад
thanks this helped so much
@aiyuayaan
@aiyuayaan 4 года назад
Thank you Soo much Sir 🥰🥰🥰🥰
@vedantbarsainya8331
@vedantbarsainya8331 3 года назад
Love your work man!!! Helped me when I had just about given uppp!!
@asishsiwakoti5564
@asishsiwakoti5564 4 года назад
thanks man i wonder for this very long time but i cant got any were but u just do this man thanks thanks and again thanks....
@saqibmasood6778
@saqibmasood6778 4 года назад
Hi Mitch. I was following this tutorial and i ended up having a recyclerview in the dialog fragment. I was able to do a toast on the recyclerview item click. But i am not able to close the dialog fragment along with that toast. I mean i click an option in the recyclerview through its adapter but i am not able close this dialog fragment along with this click, probably as i dont have a reference to the dialog fragment in the adapter of the recycler view. Can you please help me. I am still a beginner so please explain in terms of exact code to write. Thanks already for the beautiful and followable tutorials.
@fadhlifirdaussulaiman1463
@fadhlifirdaussulaiman1463 5 лет назад
Thank god I found this video T_T.. Thanks bro, it helped, gonna sub and like this video. Many thanks again, you don't know how you had helped a needy guy
@iamkrishn
@iamkrishn 3 года назад
What if I want to send some value to the dialog from the MainFragment as well? Do I need to create an interface in the MainFragment and then let the DialogFragment implement it? Or is there a workaround of some kind? I don't want the Activity to be involved in this. (Although I know that's the best practice, event bus and all...)
@muhammadzawawi1388
@muhammadzawawi1388 5 лет назад
I love the way you share the source code! u got a sub from me.
@mariamihaela9
@mariamihaela9 4 года назад
You are literally a life saver :)) ! Thanks
@rsklkldn430
@rsklkldn430 5 лет назад
Thank you. I think you're good at teaching)
@papatampan
@papatampan 2 года назад
how to set data in a Dialog EditText ? i mean, i want to load data from shared preference into EditText in a Dialog box.
@fk15156853
@fk15156853 5 лет назад
man i almost tried eveythin to get it to work , so it was a simple setTarget before lunch :3
@SinisterEclipse141
@SinisterEclipse141 4 года назад
I had the same problem!
@user-ph2ne4eh1q
@user-ph2ne4eh1q 4 года назад
How do i make it so every time i enter data in the dialog it creates a new text view and don't overwrite the old one.
@HariKrishnan-es6po
@HariKrishnan-es6po 3 года назад
Well explained 👍👍
@sahilsonkar9979
@sahilsonkar9979 4 года назад
It's a great help sir
@zipfreesty
@zipfreesty 6 лет назад
Great tutorial ! thanx a lot ! very useful for my personal project !
@neski311
@neski311 3 года назад
In minute 8:13, how do I put two EditText?
@ibrahimqassem2254
@ibrahimqassem2254 5 лет назад
Thank you So match for This Tutorial Sir
@noitrealian9960
@noitrealian9960 3 года назад
Can't call getFragmentManager in Fragment, but it works in Activity. what's the solution?
@havefun3615
@havefun3615 4 года назад
thanks a lot , you saved my day
@abdullahbaabbad885
@abdullahbaabbad885 4 года назад
Can anyone explain why using interface is better practice than the straight forward logic?
@ruif3r
@ruif3r 3 года назад
maybe an updated video of this would be nice, cheers
@dreamsmartitservices237
@dreamsmartitservices237 5 лет назад
très efficace comme tuto je suis très satisfaite
@MagicMindsAnimations
@MagicMindsAnimations 2 года назад
single Choise item how to recieve on thier dialog launching fragment i.e host fragment of dialog or which the dialog lauch
@qusaiatoon2802
@qusaiatoon2802 3 года назад
every thing was working good when i used dialogs in Activities .....but now with Framents the getFragmentManager() method is not working .....can anybody help me to find a solution ??
@vapecat
@vapecat 3 года назад
getTargetFragment() is deprecated, how to replace this? edit I found the way (i only know how to use it in kotlin so maybe you can copy paste it and let android studio convert it to java) : in MainFragment //inside your open dialog clickListener var dialog = MyCustomDialog() dialog.show(parentFragmentManager, "MyCustomDialog") dialog.setFragmentResultListener("1"){ key, bundle -> if (key == "1"){ mInputDisplay.text = bundle.getString("1") } } in MyCustomDialog //inside m.ActionOk button val input: String = mInput.getText().toString() val bundle = Bundle() bundle.putString("1", input) setFragmentResult("1", bundle) dismiss() so no need to use onAttach and implement the interface, hope this helps!
@DiamondTMZ
@DiamondTMZ 3 года назад
thanks!
@macchiato_1881
@macchiato_1881 2 года назад
oh my god you just saved me a few days worth of scouring through stackoverflow thank you so much dude
@andreyvolodko1230
@andreyvolodko1230 2 года назад
Yes, its works, but i think i got better idea. In onAttach method insted mOnInputSelected = (onInputSelected) getTargetFragment(); use mOnInputSelected = (mOnInputSelected) getParentFragmentManager().findFragmentByTag("TAG");//IMPORTANT! TAG is that you use when you cal your fragment in FragmentTransaction.replace () and when you create a dialog, insted dialog.setTargetFragment(MainFragment.this, 1); use getParentFragmentManager().setFragmentResultListener(1, MainFragment.this, new FragmentResultListener() { @Override public void onFragmentResult(@NonNull String requestKey, @NonNull Bundle result) { } }); dialog.show(getParentFragmentManager(),"MyCustomDialog") And it works exacly like when you use dialogs in Activity
@sumrjd
@sumrjd Год назад
@@andreyvolodko1230 thanks will try later
@Lawnio
@Lawnio 5 лет назад
I get a " declared fragment fragmentName that does not belong to this fragmentManager" Any ideas?
@louisth5255
@louisth5255 4 года назад
Thanks
@hectorcorniel3422
@hectorcorniel3422 6 лет назад
Hello sir , can you make a tutorial about saving spinner values, I'm working in a app I have an spinner but when I SignOut the values disappear
@annam2195
@annam2195 6 лет назад
do you know a good book for android wear? or are you going to make a tutorial for it?
@abhishek_bhardwaj
@abhishek_bhardwaj 6 лет назад
Thanks Man!.. You made my day!!
@kunaldhuria3935
@kunaldhuria3935 5 лет назад
God bless you man, but the issue i am facing is that this code crashes on screen rotation, please help.
@songqiaocui2950
@songqiaocui2950 5 лет назад
Hi, your video is great but I get trouble to let it show. Can you figure it out?
@digitalandroid8169
@digitalandroid8169 6 лет назад
Okay video, but it is best to try and keep software as loosely couple as possible - this video promotes a direct relationship between the dialog and the fragment for changing the textview. It would be better to use an interface as a callback to change the textViews. The fragment implements the interface, the fragment passes a reference of itself through an init() method when creating the interface.
@codingwithmitch
@codingwithmitch 6 лет назад
Digital Android that's what I did. Did you watch the whole video?
@digitalandroid8169
@digitalandroid8169 6 лет назад
Sorry! Did not watch the second half when I saw how you were just using setText at the start. My bad man
@codingwithmitch
@codingwithmitch 6 лет назад
No worries. Honestly happens all the time. It's because I show the "non-best-practice" way usually first. Then the best practice way.
@samo92mx
@samo92mx 6 лет назад
how you record your videos???
@zecaszecar
@zecaszecar 4 года назад
Super like for the Super man!!
@svenv32
@svenv32 5 лет назад
can we make this pop up contain user's post and people able to comment on it ? then users dismiss it when ever he wants to?
@badrlakrimi9837
@badrlakrimi9837 5 лет назад
that was so helpfull ty man :)
@samirshrestha5252
@samirshrestha5252 5 лет назад
Sir, make video on how to use dropdown menu in fragment and get selected item value
@JazibOfficial
@JazibOfficial 6 лет назад
Awesome video! BUT... Material Dialog Library is the easiest way XD jk
@roshansebastian1862
@roshansebastian1862 5 лет назад
did u mean Dialog Fragment ?
@FISH-ox1iz
@FISH-ox1iz 4 года назад
thx u it's helpful
@bernaem7703
@bernaem7703 6 лет назад
Hello my friend, great video, but the dialogfragment are callback from the activitymain but not from de an fragment, have you and example or any link where show it ? Call back an dialog fragmet from the fragment (not activity main). Thank in advance. Regards.
@Lawnio
@Lawnio 5 лет назад
Hey Berna, Could you elaborate? I might have an issue related to what your saying. I get a " declared fragment fragmentName that does not belong to this fragmentManager" something to do with the setTargetFragment
@cheokeejin856
@cheokeejin856 4 года назад
@@Lawnio Ive got the same issue. Have you resolved your problem?
@Lawnio
@Lawnio 4 года назад
@@cheokeejin856 i don't remember watching this. But for dialogs, you should check those from Material design. They are really easy to use
@arthurbarbosaqueirozbisnet104
@arthurbarbosaqueirozbisnet104 5 лет назад
Thank you!
@automationworld3357
@automationworld3357 5 лет назад
excellent...
@duncantsen3568
@duncantsen3568 6 лет назад
How on earth is your gradle build and apk install so quick? Any guides or tips?
@codingwithmitch
@codingwithmitch 6 лет назад
Duncan Tsen I clip the video 😉
@reaganr1516
@reaganr1516 5 лет назад
What is that emulator?
@codingwithmitch
@codingwithmitch 5 лет назад
It's a real device being mirrored. You can do that with a program called vysor
@samthexplorer9621
@samthexplorer9621 6 лет назад
Hey Mitch, I'm an iOS dev trying to master Android. I have a little problem I'd like you to assist me with. I want to calc the size(width and height) of a String. Folks on Stackoverflow say i should use Paint() but it couldn't give me accurate results. Do you have a more accurate way i can calculate the size of a String?
@vit6723
@vit6723 Год назад
some are depcreated but still working nice
@francofazzolari7973
@francofazzolari7973 5 лет назад
How did you comment all those lines at the same time? Nice trick 11:41
@TheEyupalkis
@TheEyupalkis 5 лет назад
@Akbar Umar and also ctrl+shift+/
@vleesevlons
@vleesevlons 6 лет назад
Does anyone know how to use a Dialog over multiple fragments?
@codingwithmitch
@codingwithmitch 6 лет назад
You mean a bunch of fragments overlayed on top of each other? Just inflate the dialog from the activity hosting them all.
@vishnu_j
@vishnu_j 3 года назад
@@codingwithmitch sir thank you so much ,but how to do with save preference were should we give that in dialogue,or in main frag please reply me 😭
@vishnu_j
@vishnu_j 3 года назад
@@codingwithmitch excuse me sir
@asifiqbal1261
@asifiqbal1261 6 лет назад
Please make an eCommerce app. using php back end, Thank you.
@ogustavozera
@ogustavozera 6 лет назад
I'm thinking of using this method to be able to change the link of a videoview.. But I do not know how to use this method to change a configuration of the class example: the person clicks the button to open the AlertDialog and has the edittext asking for the stream link of the video that will be played in Videoview, the person puts the link and automatically "Change" The link in MainActivity. Class (click in show more) I made a post on Stackoverflow.. Please help me! stackoverflow.com/questions/49435976/change-link-of-videoview
@cruisemaster6275
@cruisemaster6275 5 лет назад
This is a great tutorial. But why are you sooo fast mehn, you are carrying people along.
Далее
What are Kotlin Interfaces Used For and Why?
8:36
Просмотров 5 тыс.
ПАВЕЛ ДУРОВ АРЕСТОВАН
1:45:21
Просмотров 114 тыс.
skibidi toilet multiverse 041
06:01
Просмотров 5 млн
Model View View-Model (MVVM): Getting Started
29:12
Просмотров 398 тыс.
AlertDialog via Fragment: Android Programming
22:25
Просмотров 15 тыс.
Modularizing Android Apps
18:16
Просмотров 20 тыс.
It's time for change, it's time for Linux.
10:53
Просмотров 270 тыс.
Brutally honest advice for new .NET Web Developers
7:19
Generics: The most intimidating TypeScript feature
18:19
Why Developers Are OBSESSED With Obsidian
11:26
Просмотров 50 тыс.
ПАВЕЛ ДУРОВ АРЕСТОВАН
1:45:21
Просмотров 114 тыс.