首页 > 代码库 > 2014年8月26日 日志
2014年8月26日 日志
1 public String TAG = null; 2 3 public AbstractActivity() { 4 TAG = this.getClass().getName(); 7 } 8 9 10 @Override11 protected void onCreate(Bundle savedInstanceState) {12 super.onCreate(savedInstanceState);14 15 //去掉title16 requestWindowFeature(Window.FEATURE_NO_TITLE);17 //强制竖屏18 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);19 //设置软键盘不弹出20 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);21 //ViewTree layout Listener soft keyBoard state22 }
1 /** 2 * Called as part of the activity lifecycle when an activity is going into 3 * the background, but has not (yet) been killed. The counterpart to 4 * {@link #onResume}. 5 * 6 * <p>When activity B is launched in front of activity A, this callback will 7 * be invoked on A. B will not be created until A‘s {@link #onPause} returns, 8 * so be sure to not do anything lengthy here. 9 *10 * <p>This callback is mostly used for saving any persistent state the11 * activity is editing, to present a "edit in place" model to the user and12 * making sure nothing is lost if there are not enough resources to start13 * the new activity without first killing this one. This is also a good14 * place to do things like stop animations and other things that consume a15 * noticeable mount of CPU in order to make the switch to the next activity16 * as fast as possible, or to close resources that are exclusive access17 * such as the camera.18 * 19 * <p>In situations where the system needs more memory it may kill paused20 * processes to reclaim resources. Because of this, you should be sure21 * that all of your state is saved by the time you return from22 * this function. In general {@link #onSaveInstanceState} is used to save23 * per-instance state in the activity and this method is used to store24 * global persistent data (in content providers, files, etc.)25 * 26 * <p>After receiving this call you will usually receive a following call27 * to {@link #onStop} (after the next activity has been resumed and28 * displayed), however in some cases there will be a direct call back to29 * {@link #onResume} without going through the stopped state.30 * 31 * <p><em>Derived classes must call through to the super class‘s32 * implementation of this method. If they do not, an exception will be33 * thrown.</em></p>34 * 35 * @see #onResume36 * @see #onSaveInstanceState37 * @see #onStop38 */39 protected void onPause() {40 mCalled = true;41 }
1 r.window = r.activity.getWindow(); 2 View decor = r.window.getDecorView(); 3 decor.setVisibility(View.INVISIBLE); 4 ViewManager wm = a.getWindowManager(); 5 WindowManager.LayoutParams l = r.window.getAttributes(); 6 a.mDecor = decor; 7 l.type = WindowManager.LayoutParams.TYPE_BASE_APPLICATION; 8 l.softInputMode |= forwardBit; 9 if (a.mVisibleFromClient) {10 a.mWindowAdded = true;11 wm.addView(decor, l);12 }
good
2014年8月26日 日志
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。