One use for example is if you want to open a fragment on the side of the page for doing a specific task with the activity. For example a reading app were you'll be reading a novel and you can open a fragment dictionary when you need it and close it when you're done with it.
I would say the MAIN reason to use Fragments is ... put your finger on the Application and swipe left.. Yeah, that sort of thing just WORK with Fragments. :) Also : www.pluralsight.com/blog/software-development/android-fragments
Great videos man. Currently interning as an android dev at a small startup fresh out of learning java and these videos are saving my ass! Please keep them coming!
I like this tutorial but I had to do this twice. When messing things up I take a break, I think about what might have gone wrong and I start a new. Then success follows so on to the next project. Thanks for the lesson.
Hi, can you assist me get this working properly, I have tried this out a number of times but app crashes, when adding view pager it tells me missing constraints. I have tried with relative layout too but not succesful. so i added ignore tools to suppress missing constraints but still not working. any tips will be great.
I didnt catch where you used your mSectionsStatePagerAdapter object. you have created another adapter called "adapter" in setupView. so what happened the first one. btw just heard you from John's channel. keep going man you explain very well. and the best thing is you are fast and clear. subbed. thumbs up.
yeah I hate tutorials like going veeeery slow. I always scream "alright alright I got it move on" to the screen. being fast is hard to implement because it is not like "and this does that, that does this" etc. it is being fast and at the same time clear. watched other videos of yours today too and you always emphasise the core things to make it clear. like as soon as I got a question about something you immediatelly explain it as tutor. this is what I meant clear. keep going you immediatelly became one of my best rated online instructors with these perks and I really mean it. Thank you keep going man. *applause*
can you plz tell me what should i use 1) i used show fragment with layouts like linearlayout as container and then use FragmentTransaction object to change or call diff fragment 2) your method is new to me so where to use viewpager vs layouts as contanier when is comes to fragment if u have another video or page explaining this that could be also great thanks.
Thank you for your video. I started learning programming android last week, and your video was the missing link to understand the difference of fragments and activities. :-)
Great video, FragmentStatePageradapter is now de[precated, change this to FragmentPagerAdapter if having issues. Remember to implement new constructor as well.
Hey, thanks for this. (contrary to what other comments say, I consider the pace _exactly_ right). Just a question: how do you avoid the viewpager to scroll left/right if swiped? is there a simple fix?
@@codingwithmitch thank you. thanks to your other tutorials, however, I now figured out that there is a way without using the ViewPager at all and using custom transaction animations instead... learned even more :)
Awesome tutorial! Helped me out big time on my new Application. Couldn't decide between Activities or Fragments. This swayed me into the best choice of action!
Hey Mitch! That was a very useful video. I have just one question to ask? Why do we create a ViewPager object and add fragments to the ArrayList on setting it up? Instead why can't we just call adapter.addFragment(...) directly from the onCreate itself? What purpose do ViewPager solve?
Hi ! thanks a lot this video was really helpful instead of button click to move from one fragment to another can i swipe left or right to do so , i don't want to do it using tabs?
Mitch why should we use fragments? In my apps after playing with fragments i finally made pageviewer with simple xml layout files,all works pretty wel with full access to all subviews from activity.
I think you ended up with circular dependencies, your MainActivity uses FragmentX and FragmentX uses MainActivity ... using handlers and messages could be a better alternative to let your Activity know that it should perform a change in the UI.
for displaying toast u said to use getActivity...which gives app context. but i think getActivity gives the context of current activity. correct me if m wrong..
this is a good tutorial - but I had to convert it to FragmentStateAdapter and use ViewPager2. I am wondering, at 7:22 you add the mFragmentTitlesList array for the fragments, but you never use them. How would you use the titles array? or should I omit this line of code?
Is storing fragments in list making the app memory consuming? What if you have over 30 fragments? Is there danger of memory leaks if fragments are recreated with this approach?
Thnx for the tutorial ! Small question how can i use a function from the mainactivity in my fragment ? Or how can i pass DATA from mainactivity to Fragment, and vice versa ? Thank you !"
Nice tutorial!!! i have a question, how can i call my fragments (frag1, frag2, frag3, frag4.... etc) from another activity using a recyclerView inside in a fragment... sorry for my english
I tried to code a seekbar. I wrote the code into onCreate method and seekbar worked. I tried to wrote the same code in to a separete class but it did not work. My mistakes a part, is there some particular reason why the seekabr coding in to a separate class could not work in general ? tx
Hi MitchI got this working well. However now I want to add in a toolbar onto my main fragment, but all the examples I see how to do this don't use a FragmentPageStateAdapter, or they do it directly on the main activity instead, so can you offer any help on how to do this? I can add in the Toolbar through my XML code to the main fragment, but I can't get any items to show on it.
Hi Mitch, thank you for the response, I need to say I am an absolute noob...So in my main fragment layout from where I do the initial navigation from, in the xml file I have inserted the Toolbar, and I have positioned buttons relative to it using ConstraintLayoutThen in my FragmentMain.java file in the OnCreateView method I have put the statement setHasOptionsMenu(true) as below...public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {setHasOptionsMenu(true);View view = inflater.inflate(R.layout.fragment_main_layout, container, false); btnNavFragInnovations = (Button) view.findViewById(R.id.button1);…}and I've added the below method into this same Java file (although I never see it running in logcat!)@Override public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) { Log.i(TAG, "woohoo"); menuInflater.inflate(R.menu.top_menu, menu); super.onCreateOptionsMenu(menu, menuInflater); }And then I have created an item that you ask about to go into this Toolbar in res/menu folder called top_menu.xml ic_menu is the hamburger icon (3 horizontal stripes)The problem is that the toolbar appears in my main fragment since I have created it in the main fragment's layout file, but it doesn't show the ic_menu item.Thank you for any help.
Honestly, no I didn't before I attempted it, more just searching through various forums for similar questions.Having read the guide now (on menus and adding items to it), I still honestly don't see where I've gone wrong.It mentions to create the menu in the res\menu folder, which I have - called "top_menu.xml"In this top_menu.xml I call a drawable called ic_menu.xml as my icon. I have included the 4 minimum requirements for the menu definition, e.g. id, icon, title & showAsAction.And then in the fragment I override the onCreateOptionsMenu method to inflate menu into the fragment (which never gets called based on no logcat output).The difference I read somewhere else is that in the fragment, onCreateOptionsMenu must return void not Boolean, as well as taking a 2nd parameter MenuInflater, which I have also done, and then in the OnCreateView I must call setHasOptionsMenu(true), which I have also done, except in onCreateView, and not in onCreate method.I will keep reading and hopefully I can understand where I am going wrong.
After the app is created and running successfully, while I m inside the main activity the user can scroll through the fragments using swipe left and right, how to avoid that and why did it happen. and how to avoid it
Could you please tell me why my activity is empty? I have a bottembar and from there im initializing an intent what startrs the intent. The java class ist pointing to the right layout activity but in the app its showig me a blank white activity
Saleh Mahmood override onBackPressed in main activity. But there's more to it. You should watch my course on fragments and effective navigation on Pluralsight. It is an in-depth look at navigation with android. www.pluralsight.com/courses/android-fundamentals-effective-navigation Watch it free with this link: pluralsight.pxf.io/c/1194789/424552/7490
hello please if any one help me i put in the first fragment recyclerview and i want to navigate to the second fragment when click on iten in the recyclerview but i can't call the method setViewPager(int fragmentNumber) in the main activity for that i user inside the onBindViewHolder the holder.setItemClickListener i use FragmentTransaction transaction =((AppCompatActivity) context).getSupportFragmentManager().beginTransaction(); transaction.replace(R.id.container_categories, fragmentCategoriesDetails); transaction.commit(); but the UI for second fragment does not display that give me white screen in the viewPager
wondering if anybody has run into this issue or if you have a solution @Mitch: When I run the app on my ADV I get a blank screen. The Log shows the log message for MainActivity but not Fragment1. Is it possbile that I am having a memory issue that is preventing me from seeing the UI? I have other projects whose UI shows up but this is the only project where the UI isnt visible
So I hadn't missed any code or anything... I went through every file and the problem was in activity_main.xml I saw a suggestion on the constraint layout that said something like "upgrade to recommended version", which i did. also there was an error with the ViewPager that said "This view is not constrained...." this can be alleviated by going to the Design Tab > Right Click ViewPager Widget > Constraint Layout > Infer Constraints. Hopefully this helps someone because I was ready to toss my computer in the trash
Hi, so I'm working with an associate on an app and he's using your tutorials. he says he's having an issue with the R.id.containers. he says the R is red and cannot resolve symbol R and he's not even really sure what the R is coming from or going to. I've looked at both yours and his code and there's nothing besides "import android.util.Log;" that isn't in his code as well. any idea why R isn't recognized on his setup? Thanks in advance.
he says he tried that and it didn't work. is there anything else special you might have imported that isn't shown? or something you had to do to the studio in order to get it to work?
stranger still, when i try and build the app on my computer, i'm running into other things not working that my associate doesn't understand why they're not working
not sure if I need a database. each fragment has 2 textview and one seekbar. I want to set the value of textviews and get the value of seekbar. 4 of the above fragment for each activity, and one fragment also getting the seekbar value of all fragment.
Hey Mitch, I read the examples in the links you sent me above. However, I still have a problem...I defined an Interface in my Fragment and then implement it in main activity. It works fine. However, my problem is when I am using the 2nd instance of the same fragment in the main activity, and I do not know how to implement the 2nd fragment. Write now they are cross talking. Can you please advise?
Yes, You are correct, That's what I am doing. The reason that I did not create the 2nd fragment class is my intent to use one fragment class to inflate multiple layout (more than 2). I was testing it with two now. Is this doable?
This does not work the code is just exactly like yours, this is the only fragment example I just cant get it working, are you sure your not forgetting some details here my friend
Where would I use Fragments instead of just opening another activity? What are the benefits?
Thx :)
xD xD
Fragments are fast
One use for example is if you want to open a fragment on the side of the page for doing a specific task with the activity. For example a reading app were you'll be reading a novel and you can open a fragment dictionary when you need it and close it when you're done with it.
I would say the MAIN reason to use Fragments is ...
put your finger on the Application and swipe left.. Yeah, that sort of thing just WORK with Fragments. :)
Also : www.pluralsight.com/blog/software-development/android-fragments
Great videos man. Currently interning as an android dev at a small startup fresh out of learning java and these videos are saving my ass! Please keep them coming!
6:50 "and it's still angry.." why do i find it hilarious XD
I like this tutorial but I had to do this twice. When messing things up I take a break, I think about what might have gone wrong and I start a new. Then success follows so on to the next project. Thanks for the lesson.
Hi, can you assist me get this working properly, I have tried this out a number of times but app crashes, when adding view pager it tells me missing constraints. I have tried with relative layout too but not succesful. so i added ignore tools to suppress missing constraints but still not working. any tips will be great.
i love the way he rattles through the code - it's inspiring! 😃
I didnt catch where you used your mSectionsStatePagerAdapter object. you have created another adapter called "adapter" in setupView. so what happened the first one.
btw just heard you from John's channel. keep going man you explain very well. and the best thing is you are fast and clear.
subbed. thumbs up.
yeah I hate tutorials like going veeeery slow. I always scream "alright alright I got it move on" to the screen. being fast is hard to implement because it is not like "and this does that, that does this" etc. it is being fast and at the same time clear.
watched other videos of yours today too and you always emphasise the core things to make it clear. like as soon as I got a question about something you immediatelly explain it as tutor. this is what I meant clear.
keep going you immediatelly became one of my best rated online instructors with these perks and I really mean it.
Thank you keep going man. *applause*
you can be sure I will
I wish you could increase the text size in the next series.
great video, wanted to ask what is the difference between using a viewpager and frame layout?
Finest approach to create viewpager adapter.
Love the content. Thank you very much. My favorite part -- 6:49, its still angry. Lol!!!
Thank you, savior of final projects
Thanks.
Any easy shortcut to control video speed, SHIFT + < to slow down and SHIFT+> to make it faster .
can you plz tell me what should i use
1) i used show fragment with layouts like linearlayout as container and then use FragmentTransaction object to change or call diff fragment
2) your method is new to me so where to use viewpager vs layouts as contanier when is comes to fragment
if u have another video or page explaining this that could be also great thanks.
Thank you for your video. I started learning programming android last week, and your video was the missing link to understand the difference of fragments and activities. :-)
Great video, FragmentStatePageradapter is now de[precated, change this to FragmentPagerAdapter if having issues. Remember to implement new constructor as well.
Hey, thanks for this. (contrary to what other comments say, I consider the pace _exactly_ right). Just a question: how do you avoid the viewpager to scroll left/right if swiped? is there a simple fix?
Hey.
Google is your friend stackoverflow.com/questions/9650265/how-do-disable-paging-by-swiping-with-finger-in-viewpager-but-still-be-able-to-s
@@codingwithmitch thank you. thanks to your other tutorials, however, I now figured out that there is a way without using the ViewPager at all and using custom transaction animations instead... learned even more :)
@@enteundbaum what do you use instead of ViewPager ?
Awesome tutorial! Helped me out big time on my new Application. Couldn't decide between Activities or Fragments. This swayed me into the best choice of action!
This helps me understand fragments!thanks for the tutorial please keep this comming i'm just new in android and i find this channel really helpful
Hey Mitch! That was a very useful video.
I have just one question to ask?
Why do we create a ViewPager object and add fragments to the ArrayList on setting it up? Instead why can't we just call adapter.addFragment(...) directly from the onCreate itself?
What purpose do ViewPager solve?
Thanks Mitch :D
Hi !
thanks a lot this video was really helpful
instead of button click to move from one fragment to another can i swipe left or right to do so , i don't want to do it using tabs?
Mitch why should we use fragments? In my apps after playing with fragments i finally made pageviewer with simple xml layout files,all works pretty wel with full access to all subviews from activity.
The tutorial is a little bit to fast at some points but one of the best fragment tutorials though! :)
just player the player.
is this part of your new series?
Hey Mitch! I just waned to ask why you don't use desing editor. What is the benefit to write the xml yourself? Thanks for response.
+Mitch Tabian thanks for reply
That wasn't usefull ............ It was awsome man u clear all of my fragments doubt in one video ...... Thanks for you video
I think you ended up with circular dependencies, your MainActivity uses FragmentX and FragmentX uses MainActivity ... using handlers and messages could be a better alternative to let your Activity know that it should perform a change in the UI.
for displaying toast u said to use getActivity...which gives app context. but i think getActivity gives the context of current activity. correct me if m wrong..
Nope. Getactivity gives the activity context. Getapplicationcontext will give you the app context
this is a good tutorial - but I had to convert it to FragmentStateAdapter and use ViewPager2. I am wondering, at 7:22 you add the mFragmentTitlesList array for the fragments, but you never use them. How would you use the titles array? or should I omit this line of code?
DUDE THESE TUTORIALS ARE WHAT I HAVE BEEN LOOKING FOR! THANK YOU!
Thank you Mitch, your solution is just what i was looking for.
The mSectionStatePageAdapter in the Main Activity has no use right? He only needs the one in setUpViewPager() right ?
man, that tutorial was great!
though, just out of curiosity why'd u add m before every class level variables?
Thanks a lot!
Just something I do on global variables. I always put a lowercase 'm' infront.
my heart's in peace now
Saleh Mahmood lol
Hello! Great video! My problem is that te "back button" does not work. How can I add it to the FragmentStatePagerAdapter?
hey i could use it for my app? do i can create more things from this tutorial?
Thank you so much Sir Mitch. Hoping to meet you in person. :)
great tutorial.
it would be better to use interface instead calling of Main activtiy method setViewPager(int no)?
Yes it would be better to use an interface
Is storing fragments in list making the app memory consuming?
What if you have over 30 fragments?
Is there danger of memory leaks if fragments are recreated with this approach?
Thnx for the tutorial !
Small question how can i use a function from the mainactivity in my fragment ? Or how can i pass DATA from mainactivity to Fragment, and vice versa ?
Thank you !"
Tysm Mitch, one nit: no need for the adapter class variable in MainActivity since you just need it in setupViewPager()
can use fragment if i am creating a hymnes book app?is that the best solution?
Nice tutorial!!!
i have a question,
how can i call my fragments (frag1, frag2, frag3, frag4.... etc) from another activity using a recyclerView inside in a fragment... sorry for my english
I tried to code a seekbar. I wrote the code into onCreate method and seekbar worked.
I tried to wrote the same code in to a separete class but it did not work.
My mistakes a part, is there some particular reason why the seekabr coding in to a separate class could not work in general ?
tx
I wrote the exact same code as you but when I build it the following message appears:
Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
Glad I found your channel, very good content, keep it up! Subbed!
Hi MitchI got this working well. However now I want to add in a toolbar onto my main fragment, but all the examples I see how to do this don't use a FragmentPageStateAdapter, or they do it directly on the main activity instead, so can you offer any help on how to do this? I can add in the Toolbar through my XML code to the main fragment, but I can't get any items to show on it.
What do you mean "items to show on it?"
Hi Mitch, thank you for the response, I need to say I am an absolute noob...So in my main fragment layout from where I do the initial navigation from, in the xml file I have inserted the Toolbar, and I have positioned buttons relative to it using ConstraintLayoutThen in my FragmentMain.java file in the OnCreateView method I have put the statement setHasOptionsMenu(true) as below...public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {setHasOptionsMenu(true);View view = inflater.inflate(R.layout.fragment_main_layout, container, false);
btnNavFragInnovations = (Button) view.findViewById(R.id.button1);…}and I've added the below method into this same Java file (although I never see it running in logcat!)@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
Log.i(TAG, "woohoo");
menuInflater.inflate(R.menu.top_menu, menu);
super.onCreateOptionsMenu(menu, menuInflater);
}And then I have created an item that you ask about to go into this Toolbar in res/menu folder called top_menu.xml
ic_menu is the hamburger icon (3 horizontal stripes)The problem is that the toolbar appears in my main fragment since I have created it in the main fragment's layout file, but it doesn't show the ic_menu item.Thank you for any help.
Apologies, my reply below has had all carriage returns ignored, i.e. one huge paragraph of comments & code
@@shaunv2421 did you read through the guide?
developer.android.com/guide/topics/ui/menus
Honestly, no I didn't before I attempted it, more just searching through various forums for similar questions.Having read the guide now (on menus and adding items to it), I still honestly don't see where I've gone wrong.It mentions to create the menu in the res\menu folder, which I have - called "top_menu.xml"In this top_menu.xml I call a drawable called ic_menu.xml as my icon. I have included the 4 minimum requirements for the menu definition, e.g. id, icon, title & showAsAction.And then in the fragment I override the onCreateOptionsMenu method to inflate menu into the fragment (which never gets called based on no logcat output).The difference I read somewhere else is that in the fragment, onCreateOptionsMenu must return void not Boolean, as well as taking a 2nd parameter MenuInflater, which I have also done, and then in the OnCreateView I must call setHasOptionsMenu(true), which I have also done, except in onCreateView, and not in onCreate method.I will keep reading and hopefully I can understand where I am going wrong.
After the app is created and running successfully,
while I m inside the main activity the user can scroll through the fragments using swipe left and right, how to avoid that and why did it happen. and how to avoid it
What should we do now if the FragmentStatePagerAdapter is deprecated?
Why is mine only show blank page, its looks like main activity wont load my fragment? Any ideas?
Same thing's happening with me! got any solutions?
Tombs up for this one.
Does new Fragment1() get rid of the old Fragment1() and create a new one every time it's called?
How to communicate child fragment from parent fragment ? is it through interface or directly get reference
Always interface or viewmodel
@@codingwithmitch Thank you for your reply. if possible can you make simple video on this, no one has made video on this .
@@SRIKANTH-ls9bm I have tons of videos on this. th-cam.com/video/BVab9vDrra4/w-d-xo.html
@@codingwithmitch ok thank you
I will go through the video.
Thank you once again for your guidance and sharing the knowledge
Do I create 20 fragment activity and layouts if i am creating and activity with 20 fragments that just doesn't look right.
i have got a problem in adding fragments in second activity and switching between them.. Please help.?
Nice video and content; have you any video about map integration, it will effective if second Activity to return main activity or another;
Very nice and clear video. It helps me a lot. Thank you!
Wow, this helped a lot with Fragments! Thanks!
how to go back to previous fragments? there is no addtoBackstack() here , so i'm confused
wow, thank you, now i'm a little bit understand about fragment,
Could you please tell me why my activity is empty? I have a bottembar and from there im initializing an intent what startrs the intent. The java class ist pointing to the right layout activity but in the app its showig me a blank white activity
another Ques, how can I go back to Fragment1 from Fragment2 by tapping back button
Saleh Mahmood override onBackPressed in main activity. But there's more to it. You should watch my course on fragments and effective navigation on Pluralsight. It is an in-depth look at navigation with android.
www.pluralsight.com/courses/android-fundamentals-effective-navigation
Watch it free with this link: pluralsight.pxf.io/c/1194789/424552/7490
thanks, appreciate it!
This video helped me start my project. Thank you! :)
Hi Mitch , method adapter.add() not exist any more ? could you know any solution. Thanks.
what do you mean?
@@krcn00b by Android documentation. It's depicted.
Your tutorial is amazing! thank you!
did it all and it's a gr8 vid, but my app keeps crashing whenever i open my activity that's using fragments
amazing tutorial! well done man.
am ia wrong or not, but why you didn`t do anything with the mSectionsStatePageAdapter variable...
Yeah I forgot to use the global one. I made a local one
@@codingwithmitchThat`s fine, i was just wondering that no body noticed, :) :) any way good videos
THANKS FOR YOUR KNOWLEDGE BRO! VERY HELPFUL!
Thanks so much for this nice tutorial, it was quite explanative.
Shouldn't it be a String type array instead of a Fragment type when you declare the mFragmentTitle
what is inflater i didnt understand it please explain
all i am hearing someone is constantly keep sweeping the floor, it's so distracting :) nice tutorial man thanks!
Hi, I have followed this tutorial step by step but my app crashes (FragmentTest has stopped) what could be the solution.
I had the same problem and what I missed was I did not added the SecondActivity in the manifest file.
Thank you so much for this tutorial ! It's very helpful for me !
hello please if any one help me i put in the first fragment recyclerview and i want to navigate to the second fragment when click on iten in the recyclerview but i can't call the method setViewPager(int fragmentNumber) in the main activity for that i user inside the onBindViewHolder the holder.setItemClickListener
i use FragmentTransaction transaction =((AppCompatActivity) context).getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.container_categories, fragmentCategoriesDetails);
transaction.commit();
but the UI for second fragment does not display that give me white screen in the viewPager
wondering if anybody has run into this issue or if you have a solution @Mitch: When I run the app on my ADV I get a blank screen. The Log shows the log message for MainActivity but not Fragment1. Is it possbile that I am having a memory issue that is preventing me from seeing the UI? I have other projects whose UI shows up but this is the only project where the UI isnt visible
So I hadn't missed any code or anything... I went through every file and the problem was in activity_main.xml I saw a suggestion on the constraint layout that said something like "upgrade to recommended version", which i did. also there was an error with the ViewPager that said "This view is not constrained...." this can be alleviated by going to the Design Tab > Right Click ViewPager Widget > Constraint Layout > Infer Constraints. Hopefully this helps someone because I was ready to toss my computer in the trash
Yes i am, in the future how would I know and where would I find the correct dependency?
Thanks so much Mitch
it saying cannot resolve method getActivity() for the Toast.makeText(.......). How do i fix this?
Hi, so I'm working with an associate on an app and he's using your tutorials. he says he's having an issue with the R.id.containers. he says the R is red and cannot resolve symbol R and he's not even really sure what the R is coming from or going to. I've looked at both yours and his code and there's nothing besides "import android.util.Log;" that isn't in his code as well. any idea why R isn't recognized on his setup? Thanks in advance.
he says he tried that and it didn't work. is there anything else special you might have imported that isn't shown? or something you had to do to the studio in order to get it to work?
stranger still, when i try and build the app on my computer, i'm running into other things not working that my associate doesn't understand why they're not working
bummer. the joys of programming, eh? i'm sure we'll figure it out somehow. thanks for your help :)
0:47 FragmentStatePagerAdapter vs FragmentPagerAdapter
Awesome tutorial. Thanks!
Outstanding tutorial, thank you!
Very helpful video!
Thank you Mitch!
Thanks man!!!! You are awesome
Hey Mitch, Does any of your tutorials show the data communication b/w fragments?
between fragments, and between fragments and main activity.
however, I want want each fragment do both and receive data.
not sure if I need a database. each fragment has 2 textview and one seekbar. I want to set the value of textviews and get the value of seekbar. 4 of the above fragment for each activity, and one fragment also getting the seekbar value of all fragment.
Hey Mitch, I read the examples in the links you sent me above. However, I still have a problem...I defined an Interface in my Fragment and then implement it in main activity. It works fine. However, my problem is when I am using the 2nd instance of the same fragment in the main activity, and I do not know how to implement the 2nd fragment. Write now they are cross talking. Can you please advise?
Yes, You are correct, That's what I am doing. The reason that I did not create the 2nd fragment class is my intent to use one fragment class to inflate multiple layout (more than 2). I was testing it with two now. Is this doable?
How do you add create by user automatic the comments??
it crashes on the setUpViewPager call.
Typo while clicking on second activity it toast fragment 3
hello can u make tutorial on Android TelephonyManager class and PhoneStateChanger class and TelecomManager class
Thanks for not being and aliendian and not invading TH-cam with stupid videos.
hello sir, New java programming tutorial series start pla and upload video..
thank you a lot for the video
Thanks. You save me!!!
You saved my life, man! lol
that was good tutorial
How to handle the backstack
Thanks bro :D
i made all and i get nothing displayed
This does not work the code is just exactly like yours, this is the only fragment example I just cant get it working, are you sure your not forgetting some details here my friend
geat tutorial!
you the best