skip to Main Content

Android Studio – Can I make one function for all activity, to play, pause music

First Activity package com.example.birthdaywish; import androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.content.Intent; import android.media.MediaPlayer; import android.os.Bundle; import android.text.Editable; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public…

VIEW QUESTION

Android Studio – How to refresh list item after sorting immediately

I have a music list obtained from: MusicDatabase.kt override fun getContentProviderValue(): MutableList<Songs> { val songList = mutableListOf<Songs>() val collection = sdk29AndUp { MediaStore.Audio.Media.getContentUri(MediaStore.VOLUME_EXTERNAL) } ?: MediaStore.Audio.Media.EXTERNAL_CONTENT_URI //Get songs from provider context.contentResolver.query( collection, projection, selection, null, PreferenceHelper.storeAllSongsSortOrder //Sort order. ).use {…

VIEW QUESTION
Back To Top
Search