title: How to sort by the first letter of a word in Livedata Recyclerview?
body: <p><strong>I have dataclass retrofit from json and a LiveData.I'm sending the adapter list with observe.How to sort by the first letter of a word in observe?</strong></p>
  <pre><code>private fun getAllTeams(){
      viewModel.getMyGroupMembers().observe(viewLifecycleOwner, Observer {
              it.sortedBy {
                  it.name
              }
             it.forEach {
                 it.name.toCharArray().sorted().joinToString(&quot;&quot;)
  
             }
          Log.d(&quot;sort&quot;,it.toString())
  
          scoreAdapter.submitList(it)
          scoreAdapter.notifyDataSetChanged()
  
  
      })
  }
  </code></pre>
  <p><strong>I tried something but it dosent work</strong></p>
  <pre><code>class ScoreViewModel(private val scoreApi: ScoreApi) : ViewModel() {
  
  @ExperimentalCoroutinesApi
  private val myGroupMembers = MutableLiveData&lt;List&lt;DataClass&gt;&gt;()
  
  @ExperimentalCoroutinesApi
  fun getMyGroupMembers(): LiveData&lt;List&lt;DataClass&gt;&gt; = myGroupMembers
  
  
  fun getAllGroups(){
      viewModelScope.launch(Dispatchers.IO) {
         val response =  scoreApi.getAllGroups()
          updateUi(response)
      }
  }
  
  @ExperimentalCoroutinesApi
  private fun updateUi(update: List&lt;DataClass&gt;) {
      viewModelScope.launch(Dispatchers.Main) {
          myGroupMembers.value = update
      }
  }
  </code></pre>