本文整理汇总了Java中com.csipsimple.utils.ExtraPlugins.DynActivityPlugin类的典型用法代码示例。如果您正苦于以下问题:Java DynActivityPlugin类的具体用法?Java DynActivityPlugin怎么用?Java DynActivityPlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DynActivityPlugin类属于com.csipsimple.utils.ExtraPlugins包,在下文中一共展示了DynActivityPlugin类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildCallUiIntent
import com.csipsimple.utils.ExtraPlugins.DynActivityPlugin; //导入依赖的package包/类
public static Intent buildCallUiIntent(Context ctxt, SipCallSession callInfo) {
// Resolve the package to handle call.
if(UI_CALL_PACKAGE == null) {
UI_CALL_PACKAGE = ctxt.getPackageName();
try {
Map<String, DynActivityPlugin> callsUis = ExtraPlugins.getDynActivityPlugins(ctxt, SipManager.ACTION_SIP_CALL_UI);
String preferredPackage = SipConfigManager.getPreferenceStringValue(ctxt, SipConfigManager.CALL_UI_PACKAGE, UI_CALL_PACKAGE);
String packageName = null;
boolean foundPref = false;
for(String activity : callsUis.keySet()) {
packageName = activity.split("/")[0];
if(preferredPackage.equalsIgnoreCase(packageName)) {
UI_CALL_PACKAGE = packageName;
foundPref = true;
break;
}
}
if(!foundPref && !TextUtils.isEmpty(packageName)) {
UI_CALL_PACKAGE = packageName;
}
}catch(Exception e) {
Log.e(THIS_FILE, "Error while resolving package", e);
}
}
SipCallSession toSendInfo = new SipCallSession(callInfo);
Intent intent = new Intent(SipManager.ACTION_SIP_CALL_UI);
intent.putExtra(SipManager.EXTRA_CALL_INFO, toSendInfo);
intent.setPackage(UI_CALL_PACKAGE);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
return intent;
}