Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mmm-rain
AndroidUtilCode
提交
c890c92a
A
AndroidUtilCode
项目概览
mmm-rain
/
AndroidUtilCode
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AndroidUtilCode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c890c92a
编写于
5月 05, 2019
作者:
B
Blankj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
see 05/05 log
上级
4305698d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
10 deletion
+10
-10
lib/base/src/main/java/com/blankj/lib/base/BaseApplication.java
...se/src/main/java/com/blankj/lib/base/BaseApplication.java
+1
-1
utilcode/app/src/main/java/com/blankj/utilcode/app/UtilCodeApp.kt
.../app/src/main/java/com/blankj/utilcode/app/UtilCodeApp.kt
+1
-1
utilcode/lib/src/main/java/com/blankj/utilcode/util/BusUtils.java
.../lib/src/main/java/com/blankj/utilcode/util/BusUtils.java
+7
-7
utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/bus/BusRemoteActivity.kt
.../com/blankj/utilcode/pkg/feature/bus/BusRemoteActivity.kt
+1
-1
未找到文件。
lib/base/src/main/java/com/blankj/lib/base/BaseApplication.java
浏览文件 @
c890c92a
...
...
@@ -42,7 +42,7 @@ public class BaseApplication extends Application {
initLeakCanary
();
initLog
();
initCrash
();
//
Messenger
Utils.init();
//
Bus
Utils.init();
}
private
void
initLeakCanary
()
{
// 内存泄露检查工具
...
...
utilcode/app/src/main/java/com/blankj/utilcode/app/UtilCodeApp.kt
浏览文件 @
c890c92a
...
...
@@ -23,7 +23,7 @@ class UtilCodeApp : BaseApplication() {
Utils
.
init
(
this
)
super
.
onCreate
()
instance
=
this
//
Messenger
Utils.registerClient("com.blankj.androidutilcode")
//
Bus
Utils.registerClient("com.blankj.androidutilcode")
}
}
...
...
utilcode/lib/src/main/java/com/blankj/utilcode/util/BusUtils.java
浏览文件 @
c890c92a
...
...
@@ -346,17 +346,17 @@ public final class BusUtils {
try
{
mServer
.
send
(
msg
);
}
catch
(
RemoteException
e
)
{
Log
.
e
(
"
Messenger
Utils"
,
"onServiceConnected: "
,
e
);
Log
.
e
(
"
Bus
Utils"
,
"onServiceConnected: "
,
e
);
}
sendCachedMsg2Server
();
}
@Override
public
void
onServiceDisconnected
(
ComponentName
name
)
{
Log
.
w
(
"
Messenger
Utils"
,
"client service disconnected:"
+
name
);
Log
.
w
(
"
Bus
Utils"
,
"client service disconnected:"
+
name
);
mServer
=
null
;
if
(!
bind
())
{
Log
.
e
(
"
Messenger
Utils"
,
"client service rebind failed: "
+
name
);
Log
.
e
(
"
Bus
Utils"
,
"client service rebind failed: "
+
name
);
}
}
};
...
...
@@ -376,11 +376,11 @@ public final class BusUtils {
intent
.
setPackage
(
mPkgName
);
return
Utils
.
getApp
().
bindService
(
intent
,
mConn
,
Context
.
BIND_AUTO_CREATE
);
}
else
{
Log
.
e
(
"
Messenger
Utils"
,
"bind: the app is not running -> "
+
mPkgName
);
Log
.
e
(
"
Bus
Utils"
,
"bind: the app is not running -> "
+
mPkgName
);
return
false
;
}
}
else
{
Log
.
e
(
"
Messenger
Utils"
,
"bind: the app is not installed -> "
+
mPkgName
);
Log
.
e
(
"
Bus
Utils"
,
"bind: the app is not installed -> "
+
mPkgName
);
return
false
;
}
}
...
...
@@ -391,7 +391,7 @@ public final class BusUtils {
try
{
mServer
.
send
(
msg
);
}
catch
(
RemoteException
e
)
{
Log
.
e
(
"
Messenger
Utils"
,
"unbind: "
,
e
);
Log
.
e
(
"
Bus
Utils"
,
"unbind: "
,
e
);
}
Utils
.
getApp
().
unbindService
(
mConn
);
}
...
...
@@ -425,7 +425,7 @@ public final class BusUtils {
mServer
.
send
(
msg
);
return
true
;
}
catch
(
RemoteException
e
)
{
Log
.
e
(
"
Messenger
Utils"
,
"send2Server: "
,
e
);
Log
.
e
(
"
Bus
Utils"
,
"send2Server: "
,
e
);
return
false
;
}
}
...
...
utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/bus/BusRemoteActivity.kt
浏览文件 @
c890c92a
...
...
@@ -53,7 +53,7 @@ class BusRemoteActivity : BaseTitleActivity() {
override
fun
doBusiness
()
{
BusUtils
.
subscribe
(
BUS_KEY
,
object
:
BusUtils
.
MessageCallback
{
override
fun
onMsgCallBack
(
data
:
Bundle
?)
{
LogUtils
.
eTag
(
"
Messenger
Utils"
,
data
)
LogUtils
.
eTag
(
"
Bus
Utils"
,
data
)
}
})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录