v2.2.0 - Ouverture de l'application depuis url programmes

This commit is contained in:
2023-03-10 20:04:57 +01:00
parent 16f755d564
commit f191f2bdc2
3 changed files with 38 additions and 4 deletions

View File

@@ -215,6 +215,27 @@ public class MainActivity extends AppCompatActivity {
createDialog();
// ATTENTION: This was auto-generated to handle app links.
Intent appLinkIntent = getIntent();
String appLinkAction = appLinkIntent.getAction();
Uri appLinkData = appLinkIntent.getData();
handleIntent(getIntent());
}
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
handleIntent(intent);
}
private void handleIntent(Intent intent) {
String appLinkAction = intent.getAction();
Uri appLinkData = intent.getData();
if (Intent.ACTION_VIEW.equals(appLinkAction) && appLinkData != null){
String recipeId = appLinkData.getLastPathSegment();
Uri appData = Uri.parse(URL_PLATEFORM).buildUpon()
.appendPath(recipeId).build();
web.loadUrl(URL_PLATEFORM + appLinkData.getPath());
}
}
public boolean onCreateOptionsMenu(Menu menuOpt) {