Skip to content

Commit da02128

Browse files
committed
android 更新sdk到 6.2.7005版本
1 parent 160739e commit da02128

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

Android/app/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ android {
2929
}
3030

3131
dependencies {
32+
3233
compile fileTree(dir: 'libs', include: ['*.jar'])
33-
compile(name: 'LiteAVSDK_TRTC_6.1.6454', ext: 'aar')
34-
// compile 'com.tencent.liteav:LiteAVSDK_TRTC:6.1.6454'
34+
35+
compile(name: 'LiteAVSDK_TRTC_6.2.7005', ext: 'aar')
36+
// compile 'com.tencent.liteav:LiteAVSDK_TRTC:6.2.7005'
3537
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
3638
compile 'com.android.support:multidex:1.0.0'
3739
compile 'com.android.support:appcompat-v7:26.+'

Android/app/src/main/java/com/tencent/liteav/demo/trtc/TRTCMainActivity.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public class TRTCMainActivity extends Activity implements View.OnClickListener,
4444
private TRTCSettingDialog settingDlg;
4545
private TRTCVideoViewLayout mVideoViewLayout;
4646

47-
private TRTCCloudDef.TRTCParams trtcParams; /// TRTC SDK 视频通话房间进入所必须的参数
48-
private TRTCCloud trtcCloud; /// TRTC SDK 实例对象
49-
private TRTCCloudListener trtcListener; /// TRTC SDK 回调监听
47+
private TRTCCloudDef.TRTCParams trtcParams; /// TRTC SDK 视频通话房间进入所必须的参数
48+
private TRTCCloud trtcCloud; /// TRTC SDK 实例对象
49+
private TRTCCloudListener trtcListener; /// TRTC SDK 回调监听
5050

5151
@Override
5252
protected void onCreate( Bundle savedInstanceState) {
@@ -69,9 +69,10 @@ protected void onCreate( Bundle savedInstanceState) {
6969
//初始化 UI 控件
7070
initView();
7171

72-
//创建 TRTC SDK 实例
72+
//获取 TRTC SDK 单例
7373
trtcListener = new TRTCCloudListenerImpl(this);
74-
trtcCloud = TRTCCloud.create(this, trtcListener);
74+
trtcCloud = TRTCCloud.sharedInstance(this);
75+
trtcCloud.setListener(trtcListener);
7576

7677
//开始进入视频通话房间
7778
enterRoom();
@@ -86,12 +87,10 @@ protected void onResume() {
8687
@Override
8788
protected void onDestroy() {
8889
super.onDestroy();
89-
//销毁 trtc 实例
9090
if (trtcCloud != null) {
91+
//取消SDK回调
9192
trtcCloud.setListener(null);
92-
trtcCloud.destroy();
9393
}
94-
trtcCloud = null;
9594
}
9695

9796
@Override

Android/app/src/main/java/com/tencent/liteav/demo/trtc/TRTCNewActivity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818

1919
import com.tencent.liteav.demo.R;
20+
import com.tencent.trtc.TRTCCloud;
2021

2122
import java.util.ArrayList;
2223
import java.util.List;
@@ -98,6 +99,8 @@ public void onItemClick(int position) {
9899
@Override
99100
protected void onDestroy() {
100101
super.onDestroy();
102+
//销毁 trtc 单例,释放资源
103+
TRTCCloud.destroySharedInstance();
101104
}
102105

103106
/**

0 commit comments

Comments
 (0)