c# - 火力基地动态链接
问题描述
我对该功能有疑问
我正在使用 Xamarin.android
当我打开 url 时,应用程序打开很好,但我的任务是我在应用程序上重置密码表单我将通过电子邮件地址将 url 发送给用户,当用户单击链接时打开特定页面(reset_password形式)
我在清单中使用的
<activity android:name="com.companyname.petrol_stations_in_egypt">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSEABLE"/>
<data android:host="publicservices.page.link/resetpassword" android:scheme="https"/>
<data android:host="publicservices.page.link/resetpassword" android:scheme="http"/>
</intent-filter>
</activity>
谢谢大家
解决方案
我已经创建了自己的解决方案,但我问是否有其他方法谢谢:) 当我第一次打开应用程序时,它将通过此代码
if (Intent.DataString == "https://publicservices.page.link/resetpassword")
{
Intent intent = new Intent(this, typeof(Reset_Password));
StartActivity(intent);
}
当用户单击 url 链接时,它将在意图数据字符串中获取 url 路径,因此我输入 if 条件,然后将传递给另一种形式
推荐阅读
- javascript - Nuxt.js i18n 默认语言“找不到页面”
- javascript - 我可以将 HERE 地图徽标和使用条款移到 javasctipy API 的顶部吗?
- xamarin.forms - 如何覆盖Android的系统字体?
- python-2.7 - 在理解中创建字典或集合的语法
- swift - 在按下按钮之前,如何让 IBAction 什么都不做?
- kotlin - 为什么协程第一次在调用者线程上运行,但在第一个暂停点之后它在“Dispatchers.Unconfined”中的 DefaultExecutor 上运行?
- php - MIME 1.0 URL 包含 %0D%20
- asynchronous - 如何使 Polymer 2.x 函数异步
- json - 由于 json 指针,Sphinx 无法包含我的 JSON 定义文件
- python - 将嵌套 JSON 转换为数据框