i made my first app today using an application named "A.I.D.E". i am an android user and its my first time making an app, how can i remove my app name and lable from the top of the main screen? i named my app "YT Studio" but i dont want to show this name and lable on top of my main screen, i want it to be blank, can someone help me? i gave you my android manifest.xml
and main.java
file for the reference, i would love to edit my question for more help in future.
android manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ojhastudios.ytstudio" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="YT Studio"
android:theme="@style/AppTheme"
android:resizeableActivity = "true">
<activity
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
main.xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp" />
</LinearLayout>
edit: one fellow asked me for code, there you go
package com.mycompany.myapp;
import android.app.*;
import android.os.*;
public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
getSupportActionBar().hide();
}
}
CodePudding user response:
Go to src/main/res/values & open theme.xml :
then change your style name to NoActionBar , it remove your action bar :
CodePudding user response:
Go to res >> values >> themes
<style name="Theme.MyAppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
...
...
</style>
change it to Theme.MaterialComponents.Light.NoActionBar
, the magic here is the NoActionBar and your toolbar will be remove completely including the app title name. But you should know this, after you change it , its gonna be remove from your entire project not just the single activity.
CodePudding user response:
You can just call
getSupportActionBar().hide();
in your activity's onCreate()
method