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

OneEditTextActivityNotSelected

public class OneEditTextActivityNotSelected 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);
        Button button = new Button(this);
        button.setText("The focus is here.");
        button.setFocusableInTouchMode(true);
        button.requestFocus();
        mDefaultFocusedView = button;
        layout.addView(button);
        layout.addView(editText);

        ((ScrollView) mRootView).addView(layout);
        setContentView(mRootView);