private
void
getFirstData() {
PrefUtil.getEditor(
this
).putString(Const.PREF_KEY_NOTICE_DATA,
""
).commit();
AsyncTask.execute(
new
Runnable() {
@Override
public
void
run() {
String result = NetworkUtil.connectGet(IntroActivity.
this
, API.getHomeUrl(PrefUtil.getPref(IntroActivity.
this
).getInt(Const.PREF_KEY_SELECTED_AGE_TYPE,
0
)));
Gson gson =
new
Gson()
data = gson.fromJson(result, HomeResponse.
class
);
data.saveToLocal(IntroActivity.
this
);
result = NetworkUtil.connectGet(IntroActivity.
this
, API.FIRST_NOTICE_URL);
NoticeResponse response =
new
Gson().fromJson(result, NoticeResponse.
class
);
if
(response !=
null
&& response.getCode() ==
0
)
PrefUtil.getEditor(IntroActivity.
this
).putString(Const.PREF_KEY_NOTICE_DATA,
new
Gson().toJson(response.getNotice())).commit();
notiProcessDone();
}
});
}