因此,我试图从外部URL启动我的应用程序。我已经读到,这是通过深度链接完成的,我在我的声明文件中有以下内容
<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>但是,我似乎无法创建一个启动应用程序的URL,也无法直接创建该活动。
谢谢
发布于 2020-02-21 13:33:01
试试这段代码,这会对你有帮助
您想在该应用程序的Android Manifest文件上打开哪个应用程序,编写以下代码:-
<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"/>您想从哪个应用程序中打开该文件上的应用程序:
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);
}
});https://stackoverflow.com/questions/60339522
复制相似问题