FileDocCategorySizeDatePackage
OneEditTextActivitySelected.javaAPI DocAndroid 5.1 API2207Thu Mar 12 22:22:44 GMT 2015com.android.imftest.samples

OneEditTextActivitySelected

public class OneEditTextActivitySelected extends android.app.Activity

Fields Summary
private android.view.View
mRootView
private android.view.View
mDefaultFocusedView
Constructors Summary
Methods Summary
public android.view.ViewgetDefaultFocusedView()

        return mDefaultFocusedView;
    
public android.view.ViewgetRootView()

        return mRootView;
    
public voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        LinearLayout layout = new LinearLayout(this);
        layout.setOrientation(LinearLayout.VERTICAL);
        mRootView = new ScrollView(this);
        
        EditText editText = new EditText(this);
        editText.requestFocus();
        mDefaultFocusedView = editText;
        layout.addView(editText);

        ((ScrollView) mRootView).addView(layout);
        setContentView(mRootView);
        
        // set to resize so IME is always shown (and also so
        // ImfBaseTestCase#destructiveCheckImeInitialState thinks it should always be shown
        this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);