I m not exactly sure why this is happening but I have an idea. I m not sure what to do about it though. I ve searched the internet but haven t gotten an exact answer. Here is an error that might help. (don t question the file names)
Access denied finding property "ro.vendor.pref_scale_resolution"
I tried searching the internet, looking at my catlog, etc. But I haven t found anything.
Nothing is showing on the screen of the app I built. Here is the code.
MainActivity:
package com.example.myapplication
import android.app.Activity
import android.media.AudioAttributes
import android.media.MediaPlayer
import android.os.Bundle
import android.widget.Button
class MyActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.amogusfile)
val button = findViewById<Button>(R.id.supabutton)
button.setOnClickListener {
mediaPlayer
}
}
}
const val url = "https://www.youtube.com/watch?v=4KfC923EFsY" // your URL here
val mediaPlayer = MediaPlayer().apply {
setAudioAttributes(
AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
.setUsage(AudioAttributes.USAGE_MEDIA)
.build()
)
setDataSource(url)
prepare() // might take long! (for buffering, etc)
start()
}
amogusfile.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical"
tools:ignore="ExtraText">
<Button
android:id="@+id/supabutton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/amogus"
tools:ignore="VisualLintButtonSize" />
</LinearLayout>
If any more info is needed I will provide it.