'How to launch my app (not in google play) in disconnect mode from a QR Code like myApp://open on my OPPO that use google Lens online app?
I try to open my app with a QR Code generated : myApp://open
When I scan it, it send me an error message : "Sorry the application requested could not be launched. The content of the barcode may be invalid".
<activity
android:name="com.myCompany.LoginActivity"
android:configChanges="orientation"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<data android:scheme="myApp" android:host="open"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
<intent-filter>
<data android:scheme="myApp"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
</activity>
I try this ticket with no success.
Thanks
Solution 1:[1]
Your activity needs to be exported in order for other applications to launch it.
<activity
...
android:exported="true">
Solution 2:[2]
There is no problem with your code. However, you may be having problems due to the new "exported" logic.
If this element is set to "false" and an app tries to start the activity, the system throws an ActivityNotFoundException.
Or, there may be a problem with the QR code you simply made. Try to create from this address.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dan Harms |
| Solution 2 | Ramazan Akbal |
