1

Hi I have previously asked this question but didnt get any solution.

I have following problem with Galaxy nexus running android 4.2.

I am using camera intent to take photo. If I capture pic in landscape mode and return to activity(activity is in portrait mode with android:screenOrientation="portrait" in manifest) the status bar hides the view. It works well if pic is taken in portrait mode.

This happens only with certain devices like Galaxy Nexus and Sony Xperia Neo . I tested it on htc Desire and Samsung Ace device it works well.

please help.

View behind status barview behind status bar

whereas requiredview below status bar

EDIT: layout xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/signup_bg"
android:orientation="vertical" >
<include
    android:layout_width="match_parent"
    android:layout_height="@dimen/abs__action_bar_default_height"
    layout="@layout/titlebar_account" />
<ScrollView
    android:id="@+id/editAccountScrollView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >
    <LinearLayout
        android:id="@+id/editAccountLinearLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" >
        <include
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:layout_marginTop="16dp"
            layout="@layout/signup_basic" />
        <include
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            layout="@layout/signup_home_base" />
        <TextView
            android:id="@+id/textView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:paddingBottom="12dp"
            android:paddingLeft="16dp"
            android:paddingRight="16dp"
            android:paddingTop="10dp"
            android:text="@string/account_about_me"
            android:textColor="@color/account_headings" />
        <include
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            layout="@layout/edit_account_email_about_me" />
        <include
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            layout="@layout/edit_account_social" />
    </LinearLayout>
</ScrollView>

Gaurav Vashisth
  • 7,547
  • 8
  • 35
  • 56
  • 1
    Provide your xml code may help to identify the problem. But you can try to call view.invalidate() to request to redraw the whole view again. – Ali Imran Dec 03 '12 at 18:22
  • possible duplicate of [Android View hides behing status bar](http://stackoverflow.com/questions/13625070/android-view-hides-behing-status-bar) – Ian Roberts Dec 04 '12 at 22:08
  • http://stackoverflow.com/questions/13625070/android-view-hides-behing-status-bar was closed without any solutions. – Gaurav Vashisth Dec 11 '12 at 05:40
  • I have the same problem, I'm starting a barcode scanner intent which is landscape only, and when I come back the status bar is on top, I am also setting the orientation to portrait, did you found any solution for this? – Roberto Feb 13 '13 at 20:13
  • Kindly check last para of http://stackoverflow.com/questions/15600450/androidlayout-move-upwards-about-20dp-area-from-the-top-hides-behind-the-stat – M.J Apr 03 '13 at 05:32

2 Answers2

1

This is happening due to camera api when you launch camera app it hides the status bar and due to some problem status bar draw overlapping the layout means status bar area covers the layout. you can fix this by hiding and showing the status bar. there is nothing wrong with title bar. check here for my solution: Android:Layout move upwards & about 20dp area from the top hides behind the status bar

Community
  • 1
  • 1
M.J
  • 586
  • 6
  • 16
0

you can just do it by

 setTitle(""); leaves the title blank. 

and

setDisplayShowTitleEnabled(false); also just leaves the title blank. 
kumar_android
  • 2,273
  • 1
  • 21
  • 30