views:

12

answers:

0

I'm trying to provide a modified view for a custom Android keyboard in fullscreen mode. Therefor I'm trying to replace the extract view. In the documentation I found the following method: setExtractView(View view) - so I assume it's a public API call.

However, as you can see from the Android OS source code (snipped pasted below) it lets me only access a view that has view items with id's within the com.android.internal.* space. Otherwise I will, of course, get a NullPointerException.

public void setExtractView(View view) {
    mExtractFrame.removeAllViews();
    mExtractFrame.addView(view, new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT));
    mExtractView = view;
    if (view != null) {
        mExtractEditText = (ExtractEditText)view.findViewById(
                com.android.internal.R.id.inputExtractEditText);
        mExtractEditText.setIME(this);
        mExtractAction = (Button)view.findViewById(
                com.android.internal.R.id.inputExtractAction);
        if (mExtractAction != null) {
            mExtractAccessories = (ViewGroup)view.findViewById(
                    com.android.internal.R.id.inputExtractAccessories);
        }
        startExtractingText(false);
    } else {
        mExtractEditText = null;
        mExtractAccessories = null;
        mExtractAction = null;
    }
}

So, I'm wondering, is it a bug, that this method is within the public API or if not, how can I create a custom view with IDs in the com.android.internal.* space?


Update: Nevermind, just found this. Will check later and report back if it worked.