提问人:dcarl661 提问时间:10/26/2023 更新时间:11/7/2023 访问量:17
Jitsi Android App,如何从带有参数的意图启动到特定房间?
Jitsi Android App, how to launch from an intent with arguments to go to a specific room?
问:
如果你在特定房间中启动带有 Jitsi url 的 Android 浏览器,Jitsi 页面会有一个启动 Jitsi 应用的链接。如果你按下该链接,那么浏览器将启动 Jitsi 应用程序进入该特定房间。因此,必须有一种方法可以启动带有意图参数的 Jitsi 应用程序,以便在同一个房间开始。 有谁知道如何设置带有参数的启动意图?
我尝试使用与 URL 参数匹配的添加字符串创建意图。
答:
0赞
dcarl661
11/7/2023
#1
String cli = SharedPref.teslaVehicleId + seeLocation;
cli = cli.replaceAll("\\s+", "");
String url = "https://meet.jit.si/"
+ cli
+ "#config.prejoinConfig.enabled=false"
+ "&config.prejoinpageenabled=false"
+ "&config.startAudioOnly=true"
+ "&config.disableAudioLevels=true"
+ "&config.deeplinking.disabled=true"
+ "&userInfo.displayName=" + seeLocation
;
if(launchurl) //browser but if the app is installed try the app first
{
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW,uri);
intent.setPackage ("org.jitsi.meet");
intent.setData (Uri.parse(url));
intent.putExtra (Browser.EXTRA_APPLICATION_ID,"com.safeenv.seeLifeline");
intent.setFlags (Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK);
// Start the Jitsi Meet Android app or fall back to a web browser
try
{
startActivity(intent);
}
catch (ActivityNotFoundException e)
{
e.printStackTrace();
// Handle the case where the app is not installed, e.g., open a web browser gpt original
Intent urlIntent = new Intent(Intent.ACTION_VIEW, Uri.parse( url));
urlIntent.setFlags (Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity (urlIntent);
}
catch (Exception e)
{
e.printStackTrace();
}
//moved to the try the app first try
//Intent urlIntent = new Intent(Intent.ACTION_VIEW, Uri.parse( url));
//urlIntent.setFlags (Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK);
//startActivity (urlIntent);
}
评论
Intent
Intent