Draw a Image on FullScreen mode Android

Posted by Marcos Vasconcelos on Stack Overflow See other posts from Stack Overflow or by Marcos Vasconcelos
Published on 2011-01-14T18:51:40Z Indexed on 2011/01/14 18:53 UTC
Read the original article Hit count: 267

Filed under:
|
|
|

Hi, I already know how to get my Activity as fullscreen on Android, now I need to draw a Image in this screen.

This is my XML layout.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView android:id="@+id/image01" android:layout_width="fill_parent"
    android:layout_height="fill_parent" />
</LinearLayout>

This image is dynamic generated and drawed in the ImageView.

This is my code on my Activity.

public void onCreate(Bundle savedInstance) {
    super.onCreate(savedInstance);

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setContentView(R.layout.main);
}

But when running, the Activity is FullScreen, but the ImageView is adjusted in the center.

What's wrong?

© Stack Overflow or respective owner

Related posts about java

Related posts about android