forked from guiying712/AndroidModulePattern
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGirlsApplication.java
More file actions
50 lines (43 loc) · 1.22 KB
/
GirlsApplication.java
File metadata and controls
50 lines (43 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package debug;
import com.guiying.module.common.base.BaseApplication;
import com.guiying.module.common.http.HttpClient;
import com.guiying.module.common.http.OnResultListener;
import com.orhanobut.logger.Logger;
/**
* <p>类说明</p>
*
* @author 张华洋 2017/2/15 20:09
* @version V1.2.0
* @name GirlsApplication
*/
public class GirlsApplication extends BaseApplication {
@Override
public void onCreate() {
super.onCreate();
login();
}
/**
* 在这里模拟登陆,然后拿到sessionId或者Token
* 这样就能够在组件请求接口了
*/
private void login() {
HttpClient client = new HttpClient.Builder()
.baseUrl("http://gank.io/api/data/")
.url("福利/10/1")
.build();
client.get(new OnResultListener<String>() {
@Override
public void onSuccess(String result) {
Logger.e(result);
}
@Override
public void onError(int code, String message) {
Logger.e(message);
}
@Override
public void onFailure(String message) {
Logger.e(message);
}
});
}
}