Kotlin Android TabLayout with Fragments & ViewPager – Android Studio Tutorial for Beginners 2020

This is the video tutorial#03 of Android Studio Chat App like Facebook messenger and whatsapp clone. We will develop this app using firebase database , firebase authentication , firebase storage , firebase cloud messaging android studio for android real time push notifications.

In this video you will learn how to create an android tablayout and android viewpager in android studio. (android studio table layout tutorial with fragments)

Link to Firebase Dependencies:…

Similar Posts

35 thoughts on “Kotlin Android TabLayout with Fragments & ViewPager – Android Studio Tutorial for Beginners 2020
  1. continuesly giving erros on toolbar-toolbar_main sections. video explanation not enough for a total build at all. dont try to build within this video, or it will get fucked up, loss of time.

  2. this is what i find in my mainActivity.kt file

    package com.example.messengerapp

    import androidx.appcompat.app.AppCompatActivity

    import android.os.Bundle

    class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {





    and it looks like its different from urs

  3. 2020-08-29 11:44:17.826 309-309/? E/lowmemorykiller: Error writing /proc/1861/oom_score_adj; errno=22

    2020-08-29 11:45:41.067 280-7861/? E/ResolverController: No valid NAT64 prefix (100, <unspecified>/0)

    2020-08-29 11:45:41.123 280-7864/? E/ResolverController: No valid NAT64 prefix (100, <unspecified>/0)

    2020-08-29 11:45:41.249 280-7865/? E/ResolverController: No valid NAT64 prefix (100, <unspecified>/0)

    am getting these errors and the app crashes immediately after i logged in
    any help will be appreciated

  4. hello sir I watch your third number video and write code up to last and then click on run then the error occurs, please solve my error below I send the error Cannot fit requested classes in a single dex file (# methods: 70990 > 65536) I am waiting for your response sir

  5. Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete

    Caused by: com.android.tools.r8.utils.b: Error: null, Cannot fit requested classes in a single dex file (# methods: 65826 > 65536)


  6. at the MainActivity.kt at the SetSupportActionBa(toolbar_main) at the 19th code line i have a problem, when i add the toolbar_main in the two ( ) its red and i cant make it normal like you, please i need help

  7. If you are getting error in fragments :
    internal class ViewPagerAdapter(fragmentManager: FragmentManager) :

    then change it to :
    internal class ViewPagerAdapter(fragmentManager: FragmentManager) :
    FragmentPagerAdapter(fragmentManager, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT)

    after this if you run your code you will get mutidex error to remove that go into build.gradle(Module:App)
    then at top in defaultConfig add: multiDexEnabled true
    and in dependencies at bottom add : implementation 'com.android.support:multidex:1.0.3'

    and then you will be successfully finish this lecture…..

  8. Hi. This statement "tabLayout.setupWithViewPager(viewPager)" is causing error as unresolved reference: setupWithViewPager
    Any ideas? Any help would be appreciated. I can't find any reference anywhere else for "setupWithViewPager".

  9. Have a problem with build project,
    Found solution:
    add the library in the app gradle :

    implementation 'com.android.support:multidex:1.0.3'

    After, add in the defaultConfig of the app gradle :

    multiDexEnabled true
    and restart project, working now

  10. 1- when i tried to rewrite your code(below). FragmentManagerAdapter is changing red color. And Android Studio said me "unresolved referance". How can i solve it?
    2- my Android Studio doesnt show my codes in blue color . It is different drom yours. How can i change my editor codes show ? Can you help me sir. Im new i need your help.

    This class is deprecated.

    Switch to ViewPager2 and use FragmentStateAdapter instead. i dont know when i searched it. i found something like this. maybe you can help me?

    internal class ViewPagerAdapter(fragmentManager: FragmentManager) :




  11. in my project there is no main content, android: theme = "@ style / AppTheme.AppBarOverlay" does not recognize it and does not even recognize this:

    app: popupTheme = "@ style / AppTheme.PopupOverlay"
    can you send me the content main and the appbar overleay and popup overlay please

Leave a Reply

Your email address will not be published. Required fields are marked *