In my Kotlin app, I have a back button that from what I understand works from the AndroidManifest.xml file
Inside that file I have the following
<activity
android:name=".PodcastActivity"
android:label="Catch Up">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
when the user is on the Catch Up screen they should be able to press the back arrow and it "should" go back to MainActivity - But it seems not to be working.
I am wondering what have I missed if anything
here is the full AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drn1.drn1_player">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:allowBackup="true"
android:icon="@mipmap/drn1logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/drn1logo_round"
android:supportsRtl="true"
android:theme="@style/Theme.DRN1"
android:usesCleartextTraffic="true">
<activity
android:name=".MainActivity"
android:configChanges="orientation"
android:exported="true"
android:launchMode="singleTop"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".PodcastActivity"
android:label="Catch Up">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
</application>
</manifest>
RESPONSE TO ANSWER
I also tried
override fun onBackPressed()
{
super.onBackPressed()
val returnIntent = Intent(this, MainActivity::class.java)
startActivity(returnIntent)
}
But by it's self does nothing.