hide tablet navigation bar become full screen

October 13, 2012   ·   0 Comments

device-2012-10-13-222742


package com.example.tutorial_ui_navigation_bar_hide_show;


import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
    	
    	requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        
        
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        ImageView myImageView = (ImageView)findViewById(R.id.myimageview);
        myImageView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
     }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}

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

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="aaaa" />

    <HorizontalScrollView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content">
        <ScrollView 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
            <ImageView 
                android:id="@+id/myimageview"
                android:src="@drawable/ic_launcher"
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content"
                android:scaleType="center"/>
        </ScrollView>
 </HorizontalScrollView>
</LinearLayout>
shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Android7

Amazon

adsbygoogle

Recent Posts

Categories

Amazon