[英]Handling a deep link from the google assistant in Java
希望處理來自 Google 助理的深層鏈接。 因為我目前只有一個模擬器,所以我在測試它時遇到了麻煩(從我讀到的內容來看,它需要一個真實的設備)。 也就是說,我想知道我是否以正確的方式處理它。 我不熟悉 Kotlin 並且我的代碼正在變成意大利面試圖集成,所以我把它放在我現有的啟動器活動中只是為了嘗試讓它現在引導。 manifest 和 actions.xml 的設置就像健身應用教程一樣。
我這樣做正確嗎?
if (mAuth.getCurrentUser() != null) {
data = this.getIntent().getData();
if (data != null && data.isHierarchical()) {
uriData = data.toString();
containsStart = containsIgnoreCase(uriData,"start");
containsRun = containsIgnoreCase(uriData,"run");
if(containsStart && containsRun) {
Intent intent = new Intent(getApplication(), RunActivity.class);
intent.putExtra("runStart", true);
startActivity(intent);
}
}
else {
checkUserAccType();
}
//Else, if there is no current user, start the Authentication activity
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.