url – Android Deeplink-ThrowExceptions

Exception or error:

So I am trying to launch my app from an external URL. I have read that this is done through deeplink, and I have the following in my Manifest file:

<activity android:label="@string/title_activity_login" 
android:name="hello.world.LoginActivity" 
android:launchMode="singleTop" 
android:screenOrientation="portrait" 
android:windowSoftInputMode="stateHidden">
    <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="https" 
        android:host="hello.world.io/deeplink" 
        android:pathPrefix="/test/v2"
        />
    </intent-filter>
</activity>

But, I can not seem to craft a URL that launches the app, or that activity directly.

Thank you

How to solve:

Try this code this will help you

Which app you want to open on that app’s Android Manifest file write this code :-

 <activity
        android:name=".activity.SplashActivity"
        android:resizeableActivity="false"
        android:exported="true"
        android:screenOrientation="portrait"
        android:supportsPictureInPicture="false"
        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
        android:windowSoftInputMode="stateAlwaysHidden"
        tools:targetApi="n"/>

From Which app you want to open app on that file :-

 findViewById(R.id.btnClick).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent();
            intent.setComponent(new ComponentName("packagename(com.example)", "activity name(com.example.exampleActivity)"));
            startActivity(intent);
        }
    });

Leave a Reply

Your email address will not be published. Required fields are marked *