Question

Just created apk yesterday:)

enter image description here

it doesnt open on the whole screen! can you help by telling why? I tried on virtual one it fitted all screen...

Was it helpful?

Solution

Put this one line before setContentView

requestWindowFeature(Window.FEATURE_NO_TITLE);
//setContentView(R.layout.main_activity);

And if you want full screen then use below code:

requestWindowFeature(Window.FEATURE_NO_TITLE);

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
//setContentView(R.layout.main_activity);

Yeah, This one also. Just put theme on AndroidManifest.xml

<activity
   android:name="MainActivity"
   android:label="@string/app_name"
   android:screenOrientation="portrait"
   android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"/>

OTHER TIPS

Add this lines in your manifest file

    <activity
        android:name="activity name"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
    </activity>

also use layout.xml like this.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<RelativeLayout
    android:id="@+id/top"
    android:layout_width="fill_parent"
    android:layout_height="70dp"
    android:background="@drawable/top_home" >

    <Button
        android:id="@+id/back"
        android:layout_width="90dp"
        android:layout_height="34dp"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:layout_marginLeft="15dp"
        android:background="@drawable/about_back_selector"
        android:onClick="@string/back_click"
        android:text="@string/back"
        android:textColor="#ffffff" />

    <ImageView
        android:id="@+id/logo"
        android:layout_width="100dp"
        android:layout_height="45dp"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_marginRight="15dp"
        android:background="@drawable/logo"
        android:focusable="true"
        android:focusableInTouchMode="true" />
</RelativeLayout>

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_above="@+id/bottom"
    android:layout_below="@+id/top"
    android:background="@drawable/payment_bg" >

    <EditText
        android:id="@+id/titleedit"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="35dp"
        android:gravity="right"
        android:hint="لقب"
        android:imeOptions="actionNext"
        android:nextFocusDown="@+id/feedbackedit"
        android:padding="10dp"
        android:singleLine="true"
        android:textColor="#11116F"
        android:textColorHint="#444141"
        android:textSize="12sp" />

    <EditText
        android:id="@+id/feedbackedit"
        android:layout_width="fill_parent"
        android:layout_height="130dp"
        android:layout_below="@+id/titleedit"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:gravity="right"
        android:hint="التغذية الاسترجاعية"
        android:imeOptions="actionNext"
        android:inputType="textMultiLine"
        android:nextFocusDown="@+id/usermailedit"
        android:padding="10dp"
        android:textColor="#11116F"
        android:textColorHint="#444141"
        android:textSize="12sp" />

    <EditText
        android:id="@+id/usermailedit"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/feedbackedit"
        android:layout_marginBottom="15dp"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="15dp"
        android:gravity="right"
        android:hint="البريد الإلكتروني"
        android:imeOptions="actionDone"
        android:inputType="textEmailAddress"
        android:padding="10dp"
        android:singleLine="true"
        android:textColor="#11116F"
        android:textColorHint="#444141"
        android:textSize="12sp" />

    <Button
        android:layout_width="90dp"
        android:layout_height="35dp"
        android:layout_below="@+id/usermailedit"
        android:layout_centerHorizontal="true"
        android:layout_marginLeft="70dp"
        android:onClick="@string/send"
        android:layout_marginRight="70dp"
        android:background="@drawable/button_selector"
        android:text="حفظ"
        android:textColor="#ffffff" />
</RelativeLayout>

<RelativeLayout
    android:id="@+id/bottom"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="@drawable/bottom" >
</RelativeLayout>

have you set your layout container width to match_parent or fill_parent ?

<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
 ...
</LinearLayout>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top