Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7971759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:42:20+00:00 2026-06-04T07:42:20+00:00

I am using a Fragment class in a TabHost. This fragment inflates a KeyboardView

  • 0

I am using a Fragment class in a TabHost. This fragment inflates a KeyboardView like this:

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        if (container == null)
            return null;
        View v = inflater.inflate(R.layout.main_keyboard, container, false);

This works fine the first time onCreateView() is invoked (when the application loads). However, subsequent screen rotates (runtime configuration changes) don’t re-size the KeyboardView to landscape/portrait properly:

enter image description here enter image description here

main_keyboard.xml You can see the KeyboardView being referenced at the bottom:
`

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:gravity="center" >

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingRight="10dip" >

            <TextView
                android:id="@+id/kbd_header"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingRight="10dip"
                android:text="@string/keyboard_type" />

            <TextView
                android:id="@+id/kbd_type"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/kbd_header"
                android:text="@string/russian"
                android:textColor="#FF0000"
                android:textStyle="bold" />
        </RelativeLayout>

        <ImageButton
            android:id="@+id/btnRussian"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="10dip"
            android:contentDescription="@string/russian_keyboard"
            android:src="@drawable/russia" />

        <ImageButton
            android:id="@+id/btnEnglish"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="10dip"
            android:contentDescription="@string/english_keyboard"
            android:src="@drawable/america"
             />

        <ImageButton
            android:id="@+id/btnCombined"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:contentDescription="@string/combined"
            android:src="@drawable/combined" />

    </LinearLayout>

<com.eazyigz.RussiaMediaSearch.CustomKeyboardView
    android:id="@+id/keyboard_view"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_margin="0px"
    android:padding="0px" >
</com.eazyigz.RussiaMediaSearch.CustomKeyboardView>

Does anybody have ideas on how to make the KeyboardView resize correctly?

Thank you,
Igor

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:42:21+00:00Added an answer on June 4, 2026 at 7:42 am

    Problem solved: I was using:
    if (savedInstanceState != null) in onCreateView, and wasn’t creating a new Keyboard object every time the screen rotated. So that’s why the keyboard didn’t resize. To resolve this, I needed to run code like this every time:

    mKeyboard = new Keyboard(getActivity(), R.xml.keyboard);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using this sample : I have make my own Fragment that holds tabhost and
I'm using a struct like this: define struct _Fragment{ int a; char *seq; }Fragment;
I have the following C# code fragment: using System; class count { public static
How can I produce the following XML fragment using JAXB? <sequence md5=1de2cf633901ff1f00785735c8ce7e70>MPTINSALRKVARVRLTSG</sequence> My class
I can transition to a Fragment class using the code below, but how do
Is there a way to by using some metaprogramming trick make situation like this
I have two textures generated using a fragment shader. I want to be able
I'm trying to show a MapView inside a fragment (using the hacked compatibility library).
I am using Android's support.v4 package to develop a ViewPager containing multiple Fragment s.
I'm using Android-support-v4 I have a PagerAdapter that displays a list fragment in each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.