Running the Android app without TitleBar - android

As by default, the application name is appearing on one label like TextView. How do i remove my titlebar permanently for my application?
Any ideas?

You can use below code for that -
<activity android:name="YourActivityname" android:theme="#android:style/Theme.NoTitleBar" />
If you want the full screen of your device you can use below code -
<activity android:name="YourActivityname" android:theme="#android:style/Theme.NoTitleBar.Fullscreen" />
And, also refer Developer's Site

That is a setting based on the activity in your android manifest file.
Use the No Title Bar theme for your activity.
<activity android:name="MyActivityName" android:theme="#android:style/Theme.NoTitleBar" />

Related

Disable split screen - shows " Full screen display"

I used android:resizeableActivity="false" in mainfest inside application tag inorder to disable the split mode for my application ,
but when i open my application the below dialog is shown at the bottom of my application
on clicking "Full screen display" i get a dialog like below
the dialog says if i enable the full screen then my app will function abnormally, is there any alternative to disable split screen option.
To enable full-screen support add to the AndroidManifest.xml under the element
<meta-data android:name="android.max_aspect" android:value="2.1" />
by this, the "Full screen display" will not be shown.
in your mainfest you need
android:resizeableActivity="false"
for a Separate activity
<activity android:name=".Activity"
android:label="#string/app_name"
android:resizeableActivity="false" />
for entire APP
<application
android:resizeableActivity="false">
. . .
</application>

Android design and output not match

I'm new in Android and want to know why my app deisgn isn't same as what i deisgn in Android studio. Here is the image link:
1.Why on the top banner will appear "INC AIO" string? Is this related to the layout?How to remove?
2.Why the login button will locating too close with the password text field, not like my design?
Hope can get help frpm here. Thanks.
This is ActionBar, u can remove it, here is answer how.
U need to show us your layout file (.xml)
In AndroidManifest.xml you need to add theme inside your activity tag... to remove action bar from top.
just add this code: android:theme="#style/Theme.AppCompat.NoActionBar"
with no action bar.
example:
<activity
android:name="com.example.MainActivity"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

Stop App Screen Rotate to the Side

My app stops from working for some reason when the phone is rotated to the side and so the app does too. How can I avoid this, making it so it appears only vertically? Thanks a lot
add this to your activities in android manifest :)
android:screenOrientation = "portrait">
Here is a full example:
<activity
android:name=".Activity.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait">
</activity>
In your app's manifest file, set activity to be vertical... Its easy...

Android PreferenceActivity wiered behaviour

In my application Preference Setting Activity is not showing correctly sometimes. It goes black.
My Original Preference Activity
But sometimes it goes black and shows as below screenshot
no check boxes and list preference are visible.
When it goes black and I scroll It looks very poor
The Declaration in Manifest file
<activity
android:name="com.test.wallpaper.PreferenceSettingActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
You have need to set Background for parent layout in this xml page.
Use setbackground for parent layout in xml.

Android -- How to disscociate the name of the application from the titlebar?

I added a custom title-bar to an android application and this titlebar (which is a plain png) shows up inside the main activity. The problem is that the main activity also defines the name of the application using the label tag like this:
<activity android:name=".MainActivity"
android:theme="#style/customTheme"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
And this label is also reported on the titlebar! How to dissociate the two? (Like basically, still be able to give a name to the application without affecting my custom title-bar).
Thanks!
You can change the header of any activity by using setTitle("THE TITLE"); in the java code for the page. If you want to use a string defined in the XML FILES, you can use setTitle(R.string.stringName).
My opinion is to create your own custom title bar in the top of the screen and set the no title bar option in the manifest for the activity.
android:theme="#android:style/Theme.NoTitleBar"
try changing the label of your mainactivity to something like this android:label="#string/main_header" and define the string header in the strings.xml...
hope this good help you...

Categories

Resources