@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tabbar); ShareSDK.initSDK(this); AppManager.getAppManager().addActivity(this); mainTab = (RadioGroup) findViewById(R.id.main_tab); mainTab.setOnCheckedChangeListener(this); prepareIntent(); setupIntent(); RadioButton homebutton = (RadioButton) findViewById(R.id.radio_button1); homebutton.setChecked(true); appContext = (MyApplication) getApplication(); if (!appContext.isNetworkConnected()) { UIHelper.ToastMessage(getApplicationContext(), "当前网络不可用,请检查你的网络设置", Toast.LENGTH_SHORT); return; } checkLogin(); }
private void sendFeedback() { try { imm.hideSoftInputFromWindow(mContent.getWindowToken(), 0); String content = mContent.getText().toString(); Logger.i(content); if (StringUtils.empty(content)) { UIHelper.ToastMessage(getApplicationContext(), "请输入内容", Toast.LENGTH_SHORT); return; } loadingPd = UIHelper.showProgress(this, null, null, true); AppClient.sendFeedback( appContext, content, new ClientCallback() { @Override public void onSuccess(Entity data) { UIHelper.dismissProgress(loadingPd); show1OptionsDialog(oprators); } @Override public void onFailure(String message) { UIHelper.dismissProgress(loadingPd); UIHelper.ToastMessage(getApplicationContext(), message, Toast.LENGTH_SHORT); } @Override public void onError(Exception e) { UIHelper.dismissProgress(loadingPd); Logger.i(e); UIHelper.ToastMessage(getApplicationContext(), "网络不给力", Toast.LENGTH_SHORT); } }); } catch (Exception e) { Logger.i(e); } }