@Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); //http://stackoverflow.com/questions/4341600/how-to-prevent-multiple-instances-of-an-activity-when-it-is-launched-with-differ/ // should be in launcher activity, but all app use this can avoid the problem if(!isTaskRoot()){ Intent intent = getIntent(); String action = intent.getAction(); if(intent.hasCategory(Intent.CATEGORY_LAUNCHER) && action.equals(Intent.ACTION_MAIN)){ finish(); return; } } inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); }
protected void hideSoftKeyboard() { if (getWindow().getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) { if (getCurrentFocus() != null) inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } }
@Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); //http://stackoverflow.com/questions/4341600/how-to-prevent-multiple-instances-of-an-activity-when-it-is-launched-with-differ/ //理论上应该放在launcher activity,放在基类中所有集成此库的app都可以避免此问题 if(!isTaskRoot()){ Intent intent = getIntent(); String action = intent.getAction(); if(intent.hasCategory(Intent.CATEGORY_LAUNCHER) && action.equals(Intent.ACTION_MAIN)){ finish(); return; } } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
@Override protected void onPause() { mMapView.onPause(); if (mLocClient != null) { mLocClient.stop(); } super.onPause(); lastLocation = null; }
@Override protected void onResume() { mMapView.onResume(); if (mLocClient != null) { mLocClient.start(); } super.onResume(); }
/** * back * * @param view */ public void back(View view) { finish(); } }
@Override protected void onDestroy() { if (mLocClient != null) mLocClient.stop(); mMapView.onDestroy(); unregisterReceiver(mBaiduReceiver); super.onDestroy(); } private void initMapView() {
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
@Override protected void onPause() { mMapView.onPause(); if (mLocClient != null) { mLocClient.stop(); } super.onPause(); lastLocation = null; }
@Override protected void onResume() { mMapView.onResume(); if (mLocClient != null) { mLocClient.start(); } super.onResume(); }
/** * 返回 * * @param view */ public void back(View view) { finish(); } }
@Override protected void onDestroy() { if (mLocClient != null) mLocClient.stop(); mMapView.onDestroy(); unregisterReceiver(mBaiduReceiver); super.onDestroy(); } private void initMapView() {
@Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); //http://stackoverflow.com/questions/4341600/how-to-prevent-multiple-instances-of-an-activity-when-it-is-launched-with-differ/ // should be in launcher activity, but all app use this can avoid the problem if(!isTaskRoot()){ Intent intent = getIntent(); String action = intent.getAction(); if(intent.hasCategory(Intent.CATEGORY_LAUNCHER) && action.equals(Intent.ACTION_MAIN)){ finish(); return; } } inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); }
@Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.ease_acitivity_ding_msg_send); titleBar = (EaseTitleBar) findViewById(R.id.title_bar); msgEidtText = (EditText) findViewById(R.id.et_sendmessage); setupView(); }
protected void hideSoftKeyboard() { if (getWindow().getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) { if (getCurrentFocus() != null) inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } }
@Override protected void onPause() { super.onPause(); // Remove ack-user change listener. EaseDingMessageHelper.get().setUserUpdateListener(msg, null); }
@Override protected void onResume() { mMapView.onResume(); if (mLocClient != null) { mLocClient.start(); } super.onResume(); }
/** * back * * @param view */ public void back(View view) { finish(); } }
@Override protected void onDestroy() { if (mLocClient != null) mLocClient.stop(); mMapView.onDestroy(); unregisterReceiver(mBaiduReceiver); super.onDestroy(); } private void initMapView() {