I’m trying to record the screen of the application which starts recording using Media Projection, with “A single app” option, introduced in Android 14. In the second part of createScreenCaptureIntent, where I need to select which application screen I want to record my own application doesn’t show up.
Step 1
Step 2
I’ve found this error in the logs, I’m guessing it has to do with it.
ChooserActivity E Failed to get target intent filter: intent data and type are null
Also I’ve found this application called “XRecorder” which can record itself.
XRecorder step 2
Here is my manisfest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
<uses-permission android:name="Manifest.permission.POST_NOTIFICATIONS"/>
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ScreenRecorderExample"
tools:targetApi="34">
<activity android:name=".activity.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".service.MediaProjectionService"
android:foregroundServiceType="mediaProjection"
android:exported="false"
android:enabled="true">
</service>
</application>
</manifest>
Luka Zdjelar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.