Android uses ActivityGroup to set android: windowSoftInputMode to invalid

Source: Internet
Author: User

 

Preface

When you use ActivityGroup to set the android: windowSoftInputMode of the Activity to stateHidden to hide the keyboard, the hiding failure may occur. This problem has not been found in the simulator and in MOTOi899 (Android 1.5.

 

Statement

You are welcome to repost, but please keep the original source of the article :)

Blog: http://www.cnblogs.com

Farmer's uncle: http://www.cnblogs.com/over140

 

Model

MOTO XT800

 

Body

Add the following code to onCreate of ActivityGroup:

@ Override
Protected void onCreate (Bundle savedInstanceState ){
Super. onCreate (savedInstanceState );
// Hide the title bar
RequestWindowFeature (Window. FEATURE_NO_TITLE );
// Set Layout
SetContentView (R. layout. main );

// MOTO XT800 must be set here or the keyboard will automatically pop up
GetWindow (). setSoftInputMode (WindowManager. LayoutParams. SOFT_INPUT_STATE_HIDDEN
| WindowManager. LayoutParams. SOFT_INPUT_ADJUST_UNSPECIFIED );

For more information about ActivityGroup, check whether it is related to getDecorView. Will the setting in AndroidManifest. xml be ignored when loading the view in this way ?!

 

End

This is a strange problem. It seems that you need to pay attention to the adaptation between different models. Note that this article is intended for the MOTO XT800 model and has not encountered any other models.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.