String translateUrl = Url.getTranslateUrl(first_word);
HttpHelper.HttpResult httpResult = HttpHelper.get(translateUrl);
final String resultString = httpResult.getString();
LogUtil.e("translateWord---" + resultString);
Gson gson = new Gson();
Type type = new TypeToken<Translate>() {
}.getType();
final Translate translate = gson.fromJson(resultString, type);
if(translate.getShowapi_res_code()==0){
UIUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
et_translate_word.setText(translate.getShowapi_res_body().getBasic().getExplains().get(0));
}
});
}
}
});
}
});
}
5.2.3求职模块
用户可以通过网络服务,在此模块浏览热门招聘信息,对于感兴趣的岗位,可以进行注册登录,编写简历,进行职位申请等操作。求职模块如图5.7所示:
图5.7 求职模块图
主要实现代码如下所示:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
view_work_fragment = UIUtils.inflate(R.layout.layout_work_fragment);
WebView webView = (WebView) view_work_fragment.findViewById(R.id.wb_work_webview);
webView.requestFocus();
WebSettings webSettings = webView.getSettings();
//设置支持缩放
webSettings.setBuiltInZoomControls(true);
//设置WebView属性,能够执行Javascript脚本
webSettings.setJavaScriptEnabled(true);
//设置可以访问文件 基于Android的大学生生活小助手设计与开发(13):http://www.youerw.com/jisuanji/lunwen_1423.html