• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java UriFragment类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中io.rong.imkit.fragment.UriFragment的典型用法代码示例。如果您正苦于以下问题:Java UriFragment类的具体用法?Java UriFragment怎么用?Java UriFragment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

UriFragment类属于io.rong.imkit.fragment包,在下文中一共展示了UriFragment类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: enterSettingActivity

点赞 2

import io.rong.imkit.fragment.UriFragment; //导入依赖的package包/类
/**
 * 根据 targetid 和 ConversationType 进入到设置页面
 */
private void enterSettingActivity() {

    if (mConversationType == Conversation.ConversationType.PUBLIC_SERVICE
            || mConversationType == Conversation.ConversationType.APP_PUBLIC_SERVICE) {

        RongIM.getInstance().startPublicServiceProfile(this, mConversationType, mTargetId);
    } else {
        UriFragment fragment = (UriFragment) getSupportFragmentManager().getFragments().get(0);
        //得到讨论组的 targetId
        mTargetId = fragment.getUri().getQueryParameter("targetId");

        if (TextUtils.isEmpty(mTargetId)) {
            NToast.shortToast(mContext, "讨论组尚未创建成功");
        }


        Intent intent = null;
        if (mConversationType == Conversation.ConversationType.GROUP) {
            intent = new Intent(this, GroupDetailActivity.class);
            intent.putExtra("conversationType", Conversation.ConversationType.GROUP);
        } else if (mConversationType == Conversation.ConversationType.PRIVATE) {
            intent = new Intent(this, PrivateChatDetailActivity.class);
            intent.putExtra("conversationType", Conversation.ConversationType.PRIVATE);
        } else if (mConversationType == Conversation.ConversationType.DISCUSSION) {
            intent = new Intent(this, DiscussionDetailActivity.class);
            intent.putExtra("TargetId", mTargetId);
            startActivityForResult(intent, 166);
            return;
        }
        intent.putExtra("TargetId", mTargetId);
        if (intent != null) {
            startActivityForResult(intent, 500);
        }

    }
}
 

开发者ID:13120241790,
项目名称:RongCloudJcenter,
代码行数:40,
代码来源:ConversationActivity.java

示例2: enterSettingActivity

点赞 2

import io.rong.imkit.fragment.UriFragment; //导入依赖的package包/类
/**
 * 根据 targetid 和 ConversationType 进入到设置页面
 */
private void enterSettingActivity() {

    if (mConversationType == Conversation.ConversationType.PUBLIC_SERVICE
            || mConversationType == Conversation.ConversationType.APP_PUBLIC_SERVICE) {

        RongIM.getInstance().startPublicServiceProfile(this, mConversationType, mTargetId);
    } else {
        //当你刚刚创建完讨论组以后获得的是 targetIds
        if (!TextUtils.isEmpty(mTargetIds)) {
            UriFragment fragment = (UriFragment) getSupportFragmentManager().getFragments().get(0);
            //得到讨论组的 targetId
            mTargetId = fragment.getUri().getQueryParameter("targetId");

            if (TextUtils.isEmpty(mTargetId)) {
                WinToast.toast(ConversationActivity.this, "讨论组尚未创建成功");
            }
        }

        Uri uri = Uri.parse("demo://" + getApplicationInfo().packageName).buildUpon()
                .appendPath("conversationSetting")
                .appendPath(mConversationType.getName())
                .appendQueryParameter("targetId", mTargetId).build();

        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setData(uri);
        startActivity(intent);
    }
}
 

开发者ID:yangyunfeng666,
项目名称:demo-app-android-v2-2.3.9,
代码行数:32,
代码来源:ConversationActivity.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)