Tab Layout with Different Fragments | Learn Android #39

  Рет қаралды 40,746

Master Coding

Master Coding

Күн бұрын

Пікірлер: 218
@muhammadal8397
@muhammadal8397 3 жыл бұрын
OMG YOU'RE MY SAVIOR !! GOD BLESS YOU MY BROTHER
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Welcome and thanks. God bless you also. Subscribe and share to help us
@muhammadal8397
@muhammadal8397 3 жыл бұрын
@@MasterCodingTeam with my pleasure ... but i have one problem, when i click the tab the fragment is following but when i slide the fargment manualy the tab didn't follow, i hope you can help me solve the problem. Thx
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Hello. Please check that you have added the fragment.begintransaction() to oncreate method
@muhammadal8397
@muhammadal8397 3 жыл бұрын
@@MasterCodingTeam i didn't found any of that code in this video, can you tell me ?
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Get all our channel source codes from our udemy course www.udemy.com/course/the-complete-android-10-developer-course-mastering-android/?referralCode=416B077A169809EF5F31
@peterevans8743
@peterevans8743 2 жыл бұрын
What a great tutorial. Uses basic environment and shows a very concise way to build the tabs. What's more, the resultant code works which is more than I can say about other tutorials I've watched. Great work
@MasterCodingTeam
@MasterCodingTeam 2 жыл бұрын
Welcome and thanks. Subscribe to join our family 😘🤩
@tejasbele1456
@tejasbele1456 4 жыл бұрын
For swipe the viewPager, we have to add the PageListener too. Add this function after addOnTabSelectedListener.. Here is the function :- viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); With this you will be able to swipe viewPager :)
@kenkencw1224
@kenkencw1224 3 жыл бұрын
omg thanks~ you saved me!
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Welcome. Subscribe and share to help us
@rbouaf
@rbouaf 3 жыл бұрын
THANK YOU SIR
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Thanks. Subscribe to join our family
@brserralheiro
@brserralheiro 4 жыл бұрын
Nice tutorial. 9:12 constructor without param behavior is depricated. Given this is a 2020 video, maybe it is worth mentioning it. Behavior param determines if only current fragments are in a resumed state. If 1 is passed in, then only the current Fragment is in the Lifecycle.State.RESUMED state. All other fragments are capped at Lifecycle.State.STARTED If 0 is passed, all fragments are in the Lifecycle.State.RESUMED state and there will be callbacks to Fragment.setUserVisibleHint(boolean). Additionally, according to docs available, "this version of the pager is best for use when there are a handful of typically more static fragments to be paged through, such as a set of tabs. [ just like this nice example show here ] The fragment of each page the user visits will be kept in memory, though its view hierarchy may be destroyed when not visible. This can result in using a significant amount of memory since fragment instances can hold on to an arbitrary amount of state. For larger sets of pages, consider using FragmentStatePagerAdapter" Anyway, both are in deprication phase, so there is not much option left. Hope to have added some value. Best.
@Krutarth_Vaishnav_
@Krutarth_Vaishnav_ 3 жыл бұрын
Thank You Soo Much This is Exactly I Was Looking For.. The Last Line Of Changing Fragment While Clicking On Tab Has Saved My Project.. 🙏🙏😀😀😀😀😀 YOU DESERVE A SUBSCRIPTION
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Hehhehe welcome and thanks. Subscribe to get new android tutorials
@Krutarth_Vaishnav_
@Krutarth_Vaishnav_ 3 жыл бұрын
@@MasterCodingTeam Subscribed! 😀
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Welcome to our family
@Krutarth_Vaishnav_
@Krutarth_Vaishnav_ 3 жыл бұрын
@@MasterCodingTeam 😊
@jyoti583
@jyoti583 4 жыл бұрын
Awesome tutorial, it worked , thanks 🙂🙌. Those who are facing issue with deprecated super(fm), just replace it with super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Thanks jojo
@xiholliday
@xiholliday 4 жыл бұрын
Ty man
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Welcome. Subscribe to get more
@anashouissa9489
@anashouissa9489 4 жыл бұрын
thankk youu bro
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Welcome
@RohinMaharjan
@RohinMaharjan 3 жыл бұрын
If you need to switch tab indicators with swipe: viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { tabLayout.selectTab(tabLayout.getTabAt(position)); } @Override public void onPageScrollStateChanged(int state) { } });
@sammyboy_adventures
@sammyboy_adventures 3 жыл бұрын
Its really good. But im facing an issue in which, when i tap the tablayout buttons the indicator works, but when we scroll the viewpages of each tab sideways, the view scrolls which is good...but the tab indicator remains on the start only and does not move along with the scroll. Please suggest what do i do?
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Check your oncreate() and check fragment transaction
@sammyboy_adventures
@sammyboy_adventures 3 жыл бұрын
@@MasterCodingTeam Ok Thanks, worked on it a bit...its working well now
@hugoperez8493
@hugoperez8493 4 жыл бұрын
thank you so much ¿its possible to add webviews in each TabLayout??
@malaiibaig
@malaiibaig 3 жыл бұрын
Can we use fragments and nav graph with viewpager and tablayout?
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Yes
@martino5769
@martino5769 4 жыл бұрын
Thanks a lot for the tutorial. I have this problem: if i tap on the tabs the Fragment doesn't changing. How to fix it? I added a TabLayout.OnTabSelectedListener() so what I've to code in the OnTabSelected() method?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Yes
@kidzhobby
@kidzhobby 3 жыл бұрын
very cool , can you make a tutorial on how to search from list in fragments which are in tabbed activity from main activity
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Hello. Check the searchview tutorial in iur course
@veronikawilliams777
@veronikawilliams777 4 жыл бұрын
Realy cool )) Thanks!!!
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Thanks for honest
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Subscribe to get more tutorials
@peterartman
@peterartman 4 жыл бұрын
Thanks a lot, I was looking for this tutorial for a long time!!! I would appreciate if you will create a tutorial how to scan barcodes with ML Kit on Android. Thx again
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Thanks for your request. Welcome
@tomas62889
@tomas62889 4 жыл бұрын
Hi ,First thanks for sharing this useful video it wokrs, but I get some problem It works when I click the TabItem(ex:chats,status) When I slide the page,the page will change,but tabitem won't work (ex:when I'm in chats page,I slide the screen,It will change to status,but Tabltem will still at chats) Is there anyway to fix this problem?Or I miss anything in your video? Thanks again for your great help!
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Please check your adapter class and make fragment transaction in correct way
@tomas62889
@tomas62889 4 жыл бұрын
@@MasterCodingTeam Sorry for the late reply,I have try this for this two weeks,but the problem is still there. I think I have follow all of the steps in the video. Click the tab is work. But when I "Slide the Page" ,the tabitem won't change together In this video you didn't slide it so I think you app could have the same problem?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Please check that your fragments are well created as the video?
@tomas62889
@tomas62889 4 жыл бұрын
Master Coding Yes I done it step by step But I don’t know why this problem still there
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Hello. Can you comment below the error stack and log
@iamnoob6976
@iamnoob6976 4 жыл бұрын
Excellent Video Tutorial!! Thanks a lot
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Welcome. Subscribe to get latest tuts
@fersilent3884
@fersilent3884 4 жыл бұрын
Thanks excellent tutorial, maybe you could do a tutorial explaining. How to add a Swipe View with Tabs in Navigation Drawer
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Hello and thanks for your comment. We made a video about your request so check it on our channel
@fersilent3884
@fersilent3884 4 жыл бұрын
@@MasterCodingTeam Thanks for answering, but I have searched for that video on your channel and I can't find it, maybe you could help me with the video link
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
This video is well clear and you can follow all steps from zero to finish. This video is professional and well tested
@user-xe8vl9eh9l
@user-xe8vl9eh9l 2 жыл бұрын
hi love your channel and i love to download the app ,but theres one problem ,i am concerned about about my phone storage does the app uses local database or it fetches data from cloud so i dont have to worry about my storage
@aliaaabdelrahaman5698
@aliaaabdelrahaman5698 4 жыл бұрын
Such an amazing tutorial, it helped me a lot with my project. Can you also please do another tutorial about customizing calendars and how to add events to it, something similar to google calendar.
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Ofcourse bro
@Patrizia-tl3cd
@Patrizia-tl3cd 3 жыл бұрын
hi! Your video is really very helpful and I thank you. but I keep having problems with the Layout of my activity_main Could I ask you if I can see the full code of your activity_main.xml? Thx :-)
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Hello and thanks for your comment. You can get all source codes of our channel on udemy course www.udemy.com/course/the-complete-android-10-developer-course-mastering-android/?referralCode=416B077A169809EF5F31 Get enrolled in our udemy course. Don't miss to subscribe and share our videos
@Legend-yh2pg
@Legend-yh2pg 4 жыл бұрын
This was amazing, great work !!!! Can you do a tutorial where you update this whit some fragment comunication whit activity and other fragmnents, recycle view as a fragment would mean a loot, ty
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Welcome. We will make your tutorial soon
@androidApiCrack
@androidApiCrack 4 жыл бұрын
public class MyAdapter extends FragmentPagerAdapter { private Context myContext; int totalTabs; public MyAdapter(Context context, FragmentManager fm, int totalTabs) { super(fm); myContext = context; this.totalTabs = totalTabs; } // this is for fragment tabs @Override public Fragment getItem(int position) { switch (position) { case 0: DashBoardFrag homeFragment = new DashBoardFrag(); return homeFragment; case 1: sellsFragment sportFragment = new sellsFragment(); return sportFragment; case 2: CreditFragment movieFragment = new CreditFragment(); return movieFragment; default: return null; } } // this counts total number of tabs @Override public int getCount() { return totalTabs; } } in Main Activity public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TabLayout tabLayout = findViewById(R.id.tabMode); TabItem db = findViewById(R.id.dashboard); TabItem sells = findViewById(R.id.sales); TabItem credit = findViewById(R.id.credit); final ViewPager viewPager = findViewById(R.id.viewpager); final MyAdapter adapter = new MyAdapter(this,getSupportFragmentManager(), tabLayout.getTabCount()); viewPager.setAdapter(adapter); viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { viewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(TabLayout.Tab tab) { } @Override public void onTabReselected(TabLayout.Tab tab) { } }); } }
@mloic47
@mloic47 3 жыл бұрын
Followed the tutorial thrice already but when i click on a tab a fragment is not ben called
@sanshezakou7774
@sanshezakou7774 4 жыл бұрын
thanks u bro but just if u can put the source code in ur next tutorials it will be more amazing thank u again
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Thanks and welcome
@pstlvictoras
@pstlvictoras 4 жыл бұрын
@@MasterCodingTeam dose not work for me, can i have your source code on github?
@criaturahumanocriador
@criaturahumanocriador 4 жыл бұрын
Thank you a lot. Just wht i needed. when i sweap tabs (no clicking) the tabs headers wont change selected. any idea? tnks again
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Welcome... you can set them in the toolbar
@criaturahumanocriador
@criaturahumanocriador 4 жыл бұрын
@@MasterCodingTeam tnx. i found this solution. added: viewPager.addOnPageChangeListener(new TabLayout .TabLayoutOnPageChangeListener(tabLayout)); after tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {}. Thanks again
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Welcome bro ... we hope you enjoy our videos and courses
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Please subscribe to get latest turorials
@SVIT_ochyma_smartphone
@SVIT_ochyma_smartphone 4 жыл бұрын
@@criaturahumanocriador viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); I have addOnPageChangeListener a red glow and (tabLayout), how to fix?
@keirapascua2031
@keirapascua2031 3 жыл бұрын
Is there a way to change the colour of the line once a tab is selected?
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Yes. Make a drawable and link it with tab layout
@mitra9234
@mitra9234 4 жыл бұрын
Hey buddy thanks for the amazing tutorial , the line bellow the tab bar doesnt move when i swipe it only moves when i click on the tab item itself , what should i do ?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
You need to add fragment transaction in oncreate method
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Yes thanks
@chinmayrao3831
@chinmayrao3831 4 жыл бұрын
How do we access an item, like a textView in one of the fragment, using findViewById ???
@yokotemaki8228
@yokotemaki8228 4 жыл бұрын
amazing content but can you do it with NavigationBottomView?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Ok
@tejasbele1456
@tejasbele1456 4 жыл бұрын
I am not getting respective results after swipe
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Please check your fragment.transaction()
@tejasbele1456
@tejasbele1456 4 жыл бұрын
I got the solution -> For swipe, we have to add the PageListener too. Here is the function :- viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); With this you will be able to swipe viewPager :)
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
THnks for your feedback.
@tejasbele1456
@tejasbele1456 4 жыл бұрын
@@MasterCodingTeam 😁
@tevashoru6435
@tevashoru6435 3 жыл бұрын
Hi, how do I manage to get the status fragment as the main fragment when the app is launched ? And when I swip (not click) between each fragments the current item on the tabLayout doesn't change
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Make this change on the onCreate() and make fragment.BeginTransaction()
@tevashoru6435
@tevashoru6435 3 жыл бұрын
@@MasterCodingTeam I use viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); for the swip but I don't find any command to make the middle fragment defined as the main one
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Please check the last part of this video
@tomislav2860
@tomislav2860 4 жыл бұрын
Great tutorial. Can you show us how to add listview with checkboxes in each of these fragment instead of text?
@tomislav2860
@tomislav2860 4 жыл бұрын
Or even better recyclerview with checkboxes :)
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Ok man we will do it soon
@ActressandModels
@ActressandModels 3 жыл бұрын
thank you
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Welcome. Subscribe to join our family
@adityanair3566
@adityanair3566 4 жыл бұрын
hey! Can you tell me how to display a Listframent in tablayout? My normal fragments are displayed properly but my ListFragment isnt showung any list.
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Hello. Use viewpager
@adityanair3566
@adityanair3566 4 жыл бұрын
@@MasterCodingTeam Thanks a lot for replying. But I think you didn't get my point. Ofcourse I used viewpager2 and my usual fragments are working fine. Problem is I can't get my Listfragment to show it's list contents. My first tab is blank fragment with a text, which is working fine. Second, third and fourth tabs are Listfragments with a list content in it. But it's not showing anything
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Hello my friend. Did you add the layout for fragment 3 & 4 ? Did you include the fragments in your transaction process ?
@HyperionTseng
@HyperionTseng 3 жыл бұрын
my adapter is null so can't use this >< Attempt to invoke virtual method 'int com.google.android.material.tabs.TabLayout.getTabCount()' on a null object reference
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Check that you implemented the correct package for tablayout
@sciencesome7300
@sciencesome7300 3 жыл бұрын
I can change fragment by swiping how to disable it?
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
setSwipe(Disabled
@sciencesome7300
@sciencesome7300 3 жыл бұрын
@@MasterCodingTeam I was trying viewPager.setSwipe(Disabled) but, there's no function called *setSwipe*
@dwightkschrute2111
@dwightkschrute2111 4 жыл бұрын
When I click on the tabs everything is working like in the tutorial however when I swipe the fragment changes but the position of the tab item in the tab layout doesn't
@dwightkschrute2111
@dwightkschrute2111 4 жыл бұрын
Dw figured it out
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Hello. Please add fragment.begintransaction() in the oncreate method
@dwightkschrute2111
@dwightkschrute2111 4 жыл бұрын
@@MasterCodingTeam thanks for the help
@BappaSaikh
@BappaSaikh 4 жыл бұрын
i want to see tab layout design as like as chrome
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Ok coming soon
@yashchaudhary9914
@yashchaudhary9914 4 жыл бұрын
Keet it up bro👍👍
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Thanks for honest people like you.... we are creating new tutorials just for people like you
@OZON_JihadE
@OZON_JihadE 4 жыл бұрын
Thanks for your Tutrial, But I Have a problem (java.lang.ClassCastException: androidx.constraintlayout.widget.ConstraintLayout cannot be cast to com.google.android.material.tabs.TabLayout) can your help me please.
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Hello. You can't transform constraint to tablayout. Also you need to add material library dependency in gradle
@matt-i3r6w
@matt-i3r6w 4 жыл бұрын
I have the prroblem too , how do i fix it?
@MultiGamer0123
@MultiGamer0123 4 жыл бұрын
Help: When I´m swiping the Tabs are not refreshing(Fragment switches but the tab which is used is not refreshing)
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Check fragment.beginTransaction in onresume
@aayushmeshram4862
@aayushmeshram4862 4 жыл бұрын
@@MasterCodingTeam Please elaborate, even I got the same doubt
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Check your on resume and oncreate method
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Put code in onCreate()
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Ok man. Check our fragment video and learn how to use fragment transaction
@ShegerAi
@ShegerAi 4 жыл бұрын
No Error but The program crashs i have tryed it multiple times
@bzgede3533
@bzgede3533 4 жыл бұрын
Hello how can i open it. New fragment in the same area without leaving the tablayout when the button on the fragment is clicked.?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Yes. Fragment transaction()
@bzgede3533
@bzgede3533 4 жыл бұрын
@@MasterCodingTeam Could you write a sample code. ? I would be very pleased. Thanks from Turkey :)
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Welcome for all and for turkey. Just make two fragments and make transaction. See our fragments turorials
@JohnSmith-dr5zn
@JohnSmith-dr5zn 4 жыл бұрын
New to android studio, I can't find android.viewpager(.widget.Viewpager). Is there something I need to import?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Add the viewpager dependency
@danielecampopiano
@danielecampopiano 4 жыл бұрын
@@MasterCodingTeam how can i do it?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Search for viewpager dependency on google and then add it to gradle
@rishdhimuhammed258
@rishdhimuhammed258 3 жыл бұрын
activity must implement OnFragmentInteractionListener error please i am getting this error help me out
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Yes exaclty. Add fraent transacrion method on oncreat()
@tomhs8882
@tomhs8882 4 жыл бұрын
Hello, I have problem. I see tabs after running program, but not fragments layout (text and colored background). Android studio say that my variables for tabChat etc. are never used and in your video they are yellow and underscored. My are grayed out. What is problem, why I cant see fragments in my tabs ? Thanks.
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
You should make fragment.beginTransaction(l
@tomhs8882
@tomhs8882 4 жыл бұрын
@@MasterCodingTeam How I do that and where in this program ? Is it somewhere in Pager adapter or activity main class ?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
In the fragment adapter
@Zoohnyyy
@Zoohnyyy 4 жыл бұрын
@@MasterCodingTeam i have the same problem, i see the tabs but not the content inside
@sandeepdas1883
@sandeepdas1883 4 жыл бұрын
In viewPager.setAdapter(pagerAdapter) it says required type : Adapter and provided type : pagerAdapter . How do I fix it ?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
You need to update your sdk then attach the adapter
@egemeninceler3115
@egemeninceler3115 4 жыл бұрын
we recreating fragment classes every time we slide, right ? btw thanks a lot.
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Yes that's it. Thanks. Subscribe to get latest tutorials
@itszechs
@itszechs 4 жыл бұрын
please don't use dark theme for tutorials
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Welcome and thanks for advise
@chinmayrao3831
@chinmayrao3831 4 жыл бұрын
problem while swipe actions wont switch the tabs? use this, tabLayout.addOnTabSelectedListener(this);
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Put the methods onCreate()
@chinmayrao3831
@chinmayrao3831 4 жыл бұрын
@@MasterCodingTeam I tried but didn't work
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Check if tbe documentations has been changed
@pstlvictoras
@pstlvictoras 4 жыл бұрын
Did not work for my project, do you have an link for code source?Thank you!
@yanishappadoo9067
@yanishappadoo9067 2 жыл бұрын
how can i add a recyclerview with data on one fragment and move it to the next fragment
@MasterCodingTeam
@MasterCodingTeam 2 жыл бұрын
The same way as the video
@sajjadanas3444
@sajjadanas3444 3 жыл бұрын
Help,,,im newbie Tab wasn’t swiping with fragment but it is working onClick. So i add tablayout.setupwithviewpager(viewpager) Now tab is swiping with fragment but there is no Text or icon on the Tab 👉😶👈
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Hello. Add the swipe capability in tabs. Check the layout plz
@sajjadanas3444
@sajjadanas3444 3 жыл бұрын
@@MasterCodingTeamtabs woking with fragments, everything fine Now i want to add a custom listView on a fragment, I tried but it showing error. Any tutorial available? Without recycleView
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Hello. Please check our tutorials on our playlists.
@akbarrizaldi2989
@akbarrizaldi2989 4 жыл бұрын
Thanks Brow
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Welcome. Subscribe to get more tuts.
@aliaaabdelrahaman5698
@aliaaabdelrahaman5698 4 жыл бұрын
I have done all the steps but for some reasons when I run the program it keeps stopping and I can't see all the work done! Can you help me figure out why is this happening please?
@akankshasinha1803
@akankshasinha1803 4 жыл бұрын
While running the app in mobile its not starting. Rather just a black screen comes and the app closes. Can someone thell the issue?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Check your device if it meets the min requirements
@akankshasinha1803
@akankshasinha1803 4 жыл бұрын
@@MasterCodingTeam minimum requirements like?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Check the latest video about installing android studio and emulator on our channel
@akankshasinha1803
@akankshasinha1803 4 жыл бұрын
@@MasterCodingTeam okhy thanks
@ayansarkar2357
@ayansarkar2357 3 жыл бұрын
addOnTabSelectedListener is not working. I mean it is showing there is no method with this name. Can you help me with that ?
@preetojha9422
@preetojha9422 4 жыл бұрын
Do you know how to pass an integer data from Activity to Tab layout Fragments on Android Studio.... plz give answer fast as you can .
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Hello. Just use MVVM or shared prefrences. You can check our tutorials about these topics
@DjLiveMusic
@DjLiveMusic 4 жыл бұрын
Tab indicator can't be showing
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Check the video again plz
@DjLiveMusic
@DjLiveMusic 4 жыл бұрын
@@MasterCodingTeam Please make a tutorial about seekbar advanced
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Welcome and thanks for your request. Your request has been registered. Plz share our channel
@Mardiyansahok
@Mardiyansahok 4 жыл бұрын
please help me? how to view data josn at fragment?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Hello. Please check our json course with retrofit
@hiraaziz6274
@hiraaziz6274 4 жыл бұрын
viewPager.setAdapter(pagerAdapter); viewPager.setCurrentItem(tab.getPosition()); there is error in setAdapter (red) and setCurrentItem(red)
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Check your fragment names
@vicvic7968
@vicvic7968 4 жыл бұрын
Sir how to use tab layout with fragment bottom?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Yes
@vicvic7968
@vicvic7968 4 жыл бұрын
@@MasterCodingTeam Does Fragment support scroll view?
@ankitchopkar7787
@ankitchopkar7787 4 жыл бұрын
in fragment screen how to write tablayout.addOnTabSelectedListner(new TabLayout.OnTabSelectedListner()) please tell me sir
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Hello, Just retype it again just: tablayout.addonTabSelectedListener
@haziqaharman5919
@haziqaharman5919 4 жыл бұрын
hii, this help a lot but im having problem with tableLayout.getTabCount()); my getTabCount is red and idk what the problem with that :(
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Yes you need to update sdk
@haziqaharman5919
@haziqaharman5919 4 жыл бұрын
Okay thankyou sir! Do you have any tutorial for any sandbox online payment too? If not i would love to see that tutorial
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
No. We will make it soon
@haziqaharman5919
@haziqaharman5919 4 жыл бұрын
Hi sir i update the sdk but still red tho should i unistall and install again?
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Yes try it
@ankitchopkar7787
@ankitchopkar7787 4 жыл бұрын
In my tab item text appears in the capital letter but I want tab item text in small case letter please tell me, sir
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Change it in strings
@ankitchopkar7787
@ankitchopkar7787 4 жыл бұрын
@@MasterCodingTeam i already use @string in text
@androidApiCrack
@androidApiCrack 4 жыл бұрын
public class MyAdapter extends FragmentPagerAdapter { private Context myContext; int totalTabs; public MyAdapter(Context context, FragmentManager fm, int totalTabs) { super(fm); myContext = context; this.totalTabs = totalTabs; } // this is for fragment tabs @Override public Fragment getItem(int position) { switch (position) { case 0: DashBoardFrag homeFragment = new DashBoardFrag(); return homeFragment; case 1: sellsFragment sportFragment = new sellsFragment(); return sportFragment; case 2: CreditFragment movieFragment = new CreditFragment(); return movieFragment; default: return null; } } // this counts total number of tabs @Override public int getCount() { return totalTabs; } } // MainActivity public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TabLayout tabLayout = findViewById(R.id.tabMode); TabItem db = findViewById(R.id.dashboard); TabItem sells = findViewById(R.id.sales); TabItem credit = findViewById(R.id.credit); final ViewPager viewPager = findViewById(R.id.viewpager); final MyAdapter adapter = new MyAdapter(this,getSupportFragmentManager(), tabLayout.getTabCount()); viewPager.setAdapter(adapter); viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { viewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(TabLayout.Tab tab) { } @Override public void onTabReselected(TabLayout.Tab tab) { } }); } } //
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Please check your material dependency in manifest
@nikithabangre3392
@nikithabangre3392 4 жыл бұрын
First I created ChatFragment, but whenever I am trying to to create one more fragment , ie status fragment and call fragment I am getting error
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
You need to declare it in manifest
@nikithabangre3392
@nikithabangre3392 4 жыл бұрын
Please can u help me how to do it
@taehyungkwon476
@taehyungkwon476 4 жыл бұрын
On PagerAdaptor the line with super(fm); is crossed out :(
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Check your pager adapter class
@taehyungkwon476
@taehyungkwon476 4 жыл бұрын
@@MasterCodingTeam wow... thanks so much!
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Welcome. Subscribe to get more awesome tutorials and courses FREE
@Yes-ok5me
@Yes-ok5me 4 жыл бұрын
write this super(fm,BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Yes
@certifiedtoxicity7123
@certifiedtoxicity7123 4 жыл бұрын
When I slide the tab bar doesn't move. it only moves when the tab is clicked.
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Check your viewpager settings
@certifiedtoxicity7123
@certifiedtoxicity7123 4 жыл бұрын
@@MasterCodingTeam thanks for replying bro.
@jennenilyes1046
@jennenilyes1046 4 жыл бұрын
Help:: in fragment how to write GetSupportFRagementmanager(); ???
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Try to add supportfragmentmanager
@andesta2133
@andesta2133 4 жыл бұрын
thank you so much
@vikasmalik1744
@vikasmalik1744 4 жыл бұрын
PagerAdapater class can't run show error when Initialised in mainactivity Like Adapter = new PagerAdapater (getSupportFragmentManager(), Tab layout. getTabCount() ) ; This whole line show error PagerAdapater is abstract cannot be instantiated
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Yes. You need to set the fragments and then instantiate adapter
@djcity857
@djcity857 4 жыл бұрын
"extends FragmentActivity" add this or "new PagerAdapter(getFragmentManager()"
@worldoffun9600
@worldoffun9600 4 жыл бұрын
y you recorded with dark android studio theme... its stupid nothing is visible even at 1080p ......waste...
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Check your computer. 4k recorded
@worldoffun9600
@worldoffun9600 3 жыл бұрын
@@MasterCodingTeam ... yeah i lower my computer brightness for my eyes to less irritate.... and thats y i cant see coding lines in dark theme...... your video is good... but still dark theme is not useful because some people play the video in low resolution and dark theme is not good for that
@MasterCodingTeam
@MasterCodingTeam 3 жыл бұрын
Thanks for your advice. We will improve it soon
@Khalid_Looby
@Khalid_Looby 4 жыл бұрын
pls give discord i want to contact u or facebook
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
Check our udemy course
@MasterCodingTeam
@MasterCodingTeam 4 жыл бұрын
www.udemy.com/course/the-complete-android-10-developer-course-mastering-android/?referralCode=416B077A169809EF5F31
Navigation Drawer | Learn Android #40
21:41
Master Coding
Рет қаралды 4,4 М.
FRAGMENTS - Android Fundamentals
17:29
Philipp Lackner
Рет қаралды 335 М.
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
Family Love #funny #sigma
00:16
CRAZY GREAPA
Рет қаралды 61 МЛН
Random Emoji Beatbox Challenge #beatbox #tiktok
00:47
BeatboxJCOP
Рет қаралды 67 МЛН
HELP!!!
00:46
Natan por Aí
Рет қаралды 70 МЛН
How to STUDY so FAST it feels like CHEATING
8:03
The Angry Explainer
Рет қаралды 1,6 МЛН
TabLayout and Bottom Navigation using Fragments in Android
23:27
Tab layout in android studio
21:04
Tech Projects
Рет қаралды 2,6 М.
What Is Kotlin Multiplatform And How Does It Work? - KMP for Beginners
10:17
Coding a FULL App with AI (You Won't Believe This)
15:19
Creator Magic
Рет қаралды 181 М.
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 413 М.
React Native vs Flutter - Which should you use?
22:31
Simon Grimm
Рет қаралды 47 М.
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН