Why is it outside of your typical use case?
Apps on Android can be opened via various ways.
Be it from the launcher, notification, widgets, other apps...
For each one you can even reach a different Activity.
Not to mention users who have upgraded the app so they reach a different flow than new users...
By "sample", do you want an APK, or a whole open sourced project ?
I can't just give you something open sourced, because then it means it's easy to get my keys etc... no?
Or is it possible to show ad-consent without any key of any kind? Without even Admob account?
If you wish, it's quite easy to create the sample on your own:
1. Set up Admob account for the app.
2. Have 2 Activities that you can launch from the launcher (or one from launcher, and another from somewhere else, as I've mentioned), each with a different taskAffinity (to make sure you can switch between them via the recent-tasks). Example:
<activity
android:name=".MainActivity" android:exported="true" android:label="MainActivity"
android:taskAffinity="com.package.task_for_inventory_activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity2" android:exported="true" android:label="MainActivity2"
android:taskAffinity="com.package.task_for_work_order_activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
3. For each, follow the instructions of having the normal flow of ad-consent dialog to appear. As I can't demonstrate it without a real Admob account and key being used in the sample, I've used a simple dialog instead:
MaterialAlertDialogBuilder(this).setTitle(javaClass.simpleName).setMessage("TODO: replace this dialog with a normal official flow of ad-consent dialog").show()
4. Launch the app for first Activity. Press home button.
5.Launch the app for second Activity. Choose to accept all. In my sample, just dismiss the dialog.
6. Go back to the first Activity. You will still see the ad-consent dialog, as if you haven't chosen anything. In my sample, you will see the dialog of this Activity (makes sense, nothing has closed it).
Attached a skeleton sample, that you can "reproduce" the issue. I've created a normal dialog instead, because I can't just use the SDK here, as it won't appear and I need to have the Admob being set for the app, and yet I don't want to publish it.
So instead of the dialog I've presented, you need to add the implementation of Admob ad-consent to be shown.
If you want an APK, I can give you but in private. Will also need to explain you how to reach this situation. I can also send you a video showing the issue (but again, in private).
Sadly this website doesn't allow me to attach any ZIP/7z file. No idea how you want me to attach a sample here...
Please fix the issue on the current website, so that people can attach files here. It doesn't even tell me what are the rules of what's allowed to be attached.