I've already tried this solution but onGlobalLayout()
never gets called.
Yes, I've already set android:windowSoftInputMode="adjustResize"
in manifest.
Maybe it is because I'm using a DrawerLayout
as my activity root layout:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- The main content view -->
<LinearLayout
android:id="@+id/main_fragment_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" />
<!-- The navigation drawer -->
<LinearLayout
android:id="@+id/user_fragment_layout"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:orientation="vertical" >
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
I've tested activity_drawer_layout
and main_fragment_layout
in findViewById()
but unsuccessfully; onGlobalLayout()
never gets called. Please help me. Thanks in advance.