In this android tutorial i explorer how to make full screen activity that will hide such as Actionbar, Titlebar etc. here is very simple way to create full screen activity in android.
In this tutorial we learn two Methods to make Full screen activity in android
Method 1:
We make full screen activity by importing below package in java file:
In this tutorial we learn two Methods to make Full screen activity in android
Method 1:
We make full screen activity by importing below package in java file:
- import android.view.Window;
- import android.view.WindowManager;
Let's fun with code
Step 1: Write code into activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="This is a FullScreen activity"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
Step 2: Write code into MainActivity.java
package dev.androidapplink.fullscreenactivityapp;
import android.os.Bundle;
import android.app.Activity;
import android.view.Window;
import android.view.WindowManager;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
}
}
NOTE: No need to change in AndroidManifest.xml
Step 3: Run Your Project:
Method 2:
Step 1: Just set them in AndroidManifest.xml
<activity android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
</activity>
Enjoy Programming :)
Wow what a Great Information about World Day its incredibly charming instructive post. An obligation of appreciation is all together for the post.
ReplyDeletewhat is marketing, link building strategies, on-page seo best practices, balanced scorecard approach, what is sales, factors that influence purchasing decisions, how to increase web traffic, free internet marketing resources, free digital marketing resources
This comment has been removed by the author.
ReplyDeleteevent manager While it was always challenging enough to satisfy the needs of one audience, now there are two audiences, often with radically different needs from one another, to keep engaged. friend anniversary wishes, happy tuesday quotes and happy mothers day wishes for all moms
ReplyDelete