@Override public void handleMessage(Message msg) { switch (msg.what) { case MessageWhat.NET_REQUEST_NUMBER: if (null != msg.obj) { mNumberInfoString = (String) msg.obj; mResultTextView.setText(mNumberInfoString); } break; case MessageWhat.NET_REQUEST_WEATHER: if (null != msg.obj) { handlerWeather((String) msg.obj); } break; case MessageWhat.NET_REQUEST_NONGLI: if (null != msg.obj) { handlerNongli((String) msg.obj); } break; case MessageWhat.NET_REQUEST_AIR: if (null != msg.obj) { handlerAir((String) msg.obj); } break; default: break; } super.handleMessage(msg); }
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == getActivity().RESULT_OK) { Bundle bundle = data.getExtras(); String scanResult = bundle.getString(ExtraName.RESULT); setResultText(scanResult); } }
@Override public void onResume() { super.onResume(); DebugLog.d(TAG, "onResume"); String str = BaseUtil.paste(mContext); if (str != null && str.matches(Patterns.NUMBER_PATTERN) && !str.equals(mPasteNumberString)) { mSearchView.setText(str); mPasteNumberString = str; } searchWeather(); searchNongli(); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); }