title: why bottom navigation drawer fragment showing empty data
body: <p>I am developing news app and I have created bottom navigation with fragments and in topheadlinesfragment I am getting news data using retrofit but it is showing empty white screen 
  below
  <a href="https://i.stack.imgur.com/KMgbn.png" rel="nofollow noreferrer">empty white screen</a></p>
  
  <p>below my MainActivity_kt where I have implemented bottomnavigationdrawer with fragments</p>
  
  <pre><code>class MainActivity : AppCompatActivity() {
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
  
         val  bottomNavigationView = findViewById&lt;BottomNavigationView&gt;(R.id.bottom)
  
  
  
          bottomNavigationView.setOnNavigationItemSelectedListener {
  
              var selectedFragment = Fragment()
              when (it.itemId) {
                  R.id.top_headline -&gt; selectedFragment = TopHeadlinesFragment()
  
                  R.id.espn_news -&gt; selectedFragment = ESPNFragment()
                  R.id.bbc_sport -&gt; selectedFragment = BBCSportFragment()
                  R.id.football_italia -&gt; selectedFragment = FootballItaliaFragment()
              }
              val transaction = supportFragmentManager.beginTransaction()
              transaction.replace(R.id.frame_layout, selectedFragment)
              transaction.commit()
              return@setOnNavigationItemSelectedListener true
  
          }
      }
  }
  </code></pre>
  
  <p>below activity_main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/frame_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;com.google.android.material.bottomnavigation.BottomNavigationView
          android:layout_gravity="bottom"
          app:menu="@menu/bottomnews_nav"
          android:id="@+id/bottom"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"/&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>below my TopHeadlinesAdapter</p>
  
  <pre><code>@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
  class TopHeadlinesAdapter(val context: Context) :
      RecyclerView.Adapter&lt;TopHeadlinesAdapter.MyViewHolder&gt;() {
  
      var articleList: List&lt;Article&gt; = listOf()
  
      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
  
          val view = LayoutInflater.from(parent.context).inflate(R.layout.news_list, parent, false)
          return MyViewHolder(view)
      }
  
      override fun getItemCount(): Int {
          return articleList.size
      }
  
      @SuppressLint("NewApi")
      override fun onBindViewHolder(holder: MyViewHolder, position: Int) {
  
          holder.articleTitle.text = articleList.get(position).title
          holder.articleSourceName.text = articleList.get(position).source.name
          Picasso.get().load(articleList.get(position).urlToImage).into(holder.image)
  
          val input = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX")
          val output = SimpleDateFormat("dd/MM/yyyy")
          var d = Date()
          try {
              d = input.parse(articleList[5].publishedAt)
          } catch (e: ParseException) {
              try {
                  val fallback = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")
                  fallback.timeZone = TimeZone.getTimeZone("UTC")
                  d = fallback.parse(articleList[5].publishedAt)
              } catch (e2: ParseException) {
                  // TODO handle error
                  val formatted = output.format(d)
                  val timelinePoint = LocalDateTime.parse(formatted)
                  val now = LocalDateTime.now()
  
                  var elapsedTime = Duration.between(timelinePoint, now)
  
                  println(timelinePoint)
                  println(now)
                  elapsedTime.toMinutes()
  
                  holder.articleTime.text = "${elapsedTime.toMinutes()}"
  
              }
          }
  
      }
  
      fun setMovieListItems(articleList: List&lt;Article&gt;) {
          this.articleList = articleList
          notifyDataSetChanged()
      }
  
      @SuppressLint("NewApi")
      fun example() {
      }
  
      class MyViewHolder(itemView: View?) : RecyclerView.ViewHolder(itemView!!) {
  
          val image: ImageView = itemView!!.findViewById(R.id.imageView)
          val articleTitle: TextView = itemView!!.findViewById(R.id.articleTitle)
          val articleSourceName: TextView = itemView!!.findViewById(R.id.articleSourceName)
          val imageCategory: ImageView = itemView!!.findViewById(R.id.imageCategory)
          val articleTime: TextView = itemView!!.findViewById(R.id.articleTime)
  
      }
  }
  </code></pre>
  
  <p>below news_list.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="16dp"
          android:layout_marginBottom="16dp"&gt;
  
          &lt;ImageView
              android:id="@+id/imageView"
              android:layout_width="100dp"
              android:layout_height="85dp"
              android:layout_marginStart="16dp"
              android:layout_marginLeft="16dp"
              android:contentDescription="bbc"
              tools:background="@color/colorPrimary" /&gt;
  
          &lt;TextView
              android:id="@+id/articleTitle"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginStart="16dp"
              android:layout_marginEnd="16dp"
              android:layout_toEndOf="@id/imageView"
              android:layout_toRightOf="@id/imageView"
              android:ellipsize="end"
              android:lines="3"
              android:maxLines="3"
              android:text="1\n2\n3\n" /&gt;
  
          &lt;ImageView
              android:id="@+id/imageCategory"
              android:layout_width="32dp"
              android:layout_height="32dp"
              android:layout_below="@id/articleTitle"
              android:layout_marginStart="16dp"
              android:layout_marginLeft="16dp"
              android:layout_toEndOf="@id/imageView"
              android:layout_toRightOf="@id/imageView"
              android:src="@drawable/ic_espn"
              tools:background="@color/colorPrimary" /&gt;
  
          &lt;TextView
              android:id="@+id/articleSourceName"
              android:layout_width="wrap_content"
              android:layout_height="32dp"
              android:layout_below="@id/articleTitle"
              android:layout_marginStart="16dp"
              android:layout_marginLeft="16dp"
              android:layout_toEndOf="@id/imageCategory"
              android:layout_toRightOf="@id/imageCategory"
              android:gravity="center|start"
              android:text="Onefootbal" /&gt;
  
          &lt;TextView
              android:id="@+id/articleTime"
              android:layout_width="wrap_content"
              android:layout_height="32dp"
              android:layout_below="@id/articleTitle"
              android:layout_alignParentEnd="true"
              android:layout_alignParentRight="true"
              android:layout_marginStart="16dp"
              android:layout_marginEnd="16dp"
              android:layout_toEndOf="@id/articleSourceName"
              android:layout_toRightOf="@id/articleSourceName"
              android:gravity="center|start"
              android:text="- 1h"
              android:textColor="@android:color/darker_gray"
              tools:ignore="NotSibling" /&gt;
      &lt;/RelativeLayout&gt;
  
  &lt;/androidx.cardview.widget.CardView&gt;
  </code></pre>
  
  <p>below TopHeadlinesFragment where I am getting news data using retrofit</p>
  
  <pre><code>class TopHeadlinesFragment : Fragment() {
      var topHeadlinesAdapter: TopHeadlinesAdapter? = null
  
      //3
      override fun onCreateView(
          inflater: LayoutInflater,
          container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View? {
          val view =  inflater.inflate(
              R.layout.fragment_top_headlines
              , container, false
          )
  
         val recyclerView = view.findViewById (R.id.recyclerView) as RecyclerView
          recyclerView.layoutManager = LinearLayoutManager(context)
          recyclerView.adapter = topHeadlinesAdapter
  
  
          val apiInterface = SportNewsInterface.create().getNews()
  
  
          apiInterface.enqueue(object : Callback&lt;SportNewsResponse&gt; {
              override fun onResponse(
                  call: Call&lt;SportNewsResponse&gt;?,
                  response: Response&lt;SportNewsResponse&gt;?
              ) {
  
                  if (response?.body() != null) topHeadlinesAdapter?.setMovieListItems(response.body()!!.articles)
              }
  
              override fun onFailure(call: Call&lt;SportNewsResponse&gt;?, t: Throwable?) {
  
              }
          })
          return view
      }
  }
  </code></pre>
  
  <p>below fragment_top_headlines.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      &gt;
  
      &lt;androidx.recyclerview.widget.RecyclerView
          android:id="@+id/recyclerView"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p>below my logcat</p>
  
  <pre><code>2019-10-10 15:23:07.818 27558-27558/yodgorbek.komilov.musobaqayangiliklari E/RecyclerView: No adapter attached; skipping layout
  2019-10-10 15:23:08.324 27558-27558/yodgorbek.komilov.musobaqayangiliklari E/RecyclerView: No adapter attached; skipping layout
  2019-10-10 15:23:09.497 27558-27558/yodgorbek.komilov.musobaqayangiliklari E/RecyclerView: No adapter attached; skipping layout
  2019-10-10 15:23:12.277 27558-27558/yodgorbek.komilov.musobaqayangiliklari E/RecyclerView: No adapter attached; skipping layout
  2019-10-10 15:23:14.761 27558-27558/yodgorbek.komilov.musobaqayangiliklari E/RecyclerView: No adapter attached; skipping layout
  2019-10-10 15:23:21.146 27558-27558/yodgorbek.komilov.musobaqayangiliklari E/RecyclerView: No adapter attached; skipping layout
  2019-10-10 15:23:21.452 27558-27558/yodgorbek.komilov.musobaqayangiliklari E/RecyclerView: No adapter attached; skipping layout
  </code></pre>