'App good with one new intent but when I tap on same link again. Get error: No Activity found to handle Intent { act=android.intent.action.VIEW
I use Intent to send message from website to Progressive Web App. Just to show admob ads in native code. Best solution what I found is add code to
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
showInterstatial();
Simple and work but only one time. As I understand when I use onNewIntent it is replace onCreate and not register activity where android:launchMode="singleInstance"
and
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="octoads"/>
</intent-filter>
When I use more then one time this intent I got this error:
Process: online.octonauts.creaturer, PID: 709
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=octoads://octon.online?m=inter pkg=com.android.chrome (has extras) }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2100)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1747)
at android.app.Activity.startActivityForResult(Activity.java:5465)
at android.app.Activity.startActivityForResult(Activity.java:5423)
at android.app.Activity.startActivity(Activity.java:5809)
at androidx.core.content.ContextCompat$Api16Impl.startActivity(ContextCompat.java:830)
at androidx.core.content.ContextCompat.startActivity(ContextCompat.java:279)
at androidx.browser.trusted.TrustedWebActivityIntent.launchTrustedWebActivity(TrustedWebActivityIntent.java:48)
at com.google.androidbrowserhelper.trusted.TwaLauncher.launchWhenSplashScreenReady(TwaLauncher.java:273)
at com.google.androidbrowserhelper.trusted.TwaLauncher.lambda$launchWhenSessionEstablished$4$com-google-androidbrowserhelper-trusted-TwaLauncher(TwaLauncher.java:257)
at com.google.androidbrowserhelper.trusted.TwaLauncher$$ExternalSyntheticLambda3.run(Unknown Source:6)
at com.google.androidbrowserhelper.trusted.splashscreens.PwaWrapperSplashScreenStrategy.lambda$onSplashImageTransferred$1$com-google-androidbrowserhelper-trusted-splashscreens-PwaWrapperSplashScreenStrategy(PwaWrapperSplashScreenStrategy.java:208)
at com.google.androidbrowserhelper.trusted.splashscreens.PwaWrapperSplashScreenStrategy$$ExternalSyntheticLambda1.run(Unknown Source:4)
at com.google.androidbrowserhelper.trusted.splashscreens.PwaWrapperSplashScreenStrategy.runWhenEnterAnimationComplete(PwaWrapperSplashScreenStrategy.java:215)
at com.google.androidbrowserhelper.trusted.splashscreens.PwaWrapperSplashScreenStrategy.onSplashImageTransferred(PwaWrapperSplashScreenStrategy.java:207)
at com.google.androidbrowserhelper.trusted.splashscreens.PwaWrapperSplashScreenStrategy.lambda$configureTwaBuilder$0$com-google-androidbrowserhelper-trusted-splashscreens-PwaWrapperSplashScreenStrategy(PwaWrapperSplashScreenStrategy.java:195)
at com.google.androidbrowserhelper.trusted.splashscreens.PwaWrapperSplashScreenStrategy$$ExternalSyntheticLambda0.onFinished(Unknown Source:6)
at com.google.androidbrowserhelper.trusted.splashscreens.SplashImageTransferTask$1.onPostExecute(SplashImageTransferTask.java:144)
at com.google.androidbrowserhelper.trusted.splashscreens.SplashImageTransferTask$1.onPostExecute(SplashImageTransferTask.java:91)
at android.os.AsyncTask.finish(AsyncTask.java:771)
at android.os.AsyncTask.access$900(AsyncTask.java:199)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8582)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133)
```
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|