83.7 Performing the Activity Initialization
The next step is to modify the activity to perform a number of initialization tasks. Remaining within the MainActivity.kt file, modify the code as follows:
.
.
import android.media.MediaRecorder
import android.os.Environment
import android.view.View
import android.media.MediaPlayer
import kotlinx.android.synthetic.main.activity_main.*
.
.
class MainActivity : AppCompatActivity() {
private var mediaRecorder: MediaRecorder? = null
private var mediaPlayer: MediaPlayer? = null
private var audioFilePath: String? = null
private var isRecording = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView...