TabActivity Implementing - android

I am trying to make a tab activity. It works fine . I make
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" in the definition in manifest file. But sometimes it does not take the full screen when launching. My program starts from a splash screen. That is an normal activity. My tab is at the buttom of the screen. So the tabs are go inside the screen.
Does Anyone know about the problem?

Remove .FullScreen and instead use
android:theme="#android:style/Theme.NoTitleBar"
with your activity tags in AndroidManifest.XML, worked out for me
EDIT
in your Activity onCreate method use
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

Related

how to rotate a fragment inside an activity without activity rotation?

There is an android program
I have a bottom navigation bar inside my app that i don't want to change its orientation because of quality reduce
I want to rotate a fragment inside an activity when change orientation of the phone without activity rotation. how can i do this?
Thanks.
Open your Manifest.XML
Find your activity.
Add tag inside
<activity
android:configChanges="orientation"/>

Android fullscreen activity without battery icon

I am developing an android application which contains a full screen activity but i am unable to hide default android battery , time etc. icons from the screen
For example :-
I think this is something like android immersive full screen view
So can any one tell me how can i achieve this
you can do it in java file by
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
or in AndroidManifest.xml
<activity android:name=".ActivityName"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"/>
With transparent notification bar read this link.
There is a new feature called Immersive FullScreen mode where all the UI elements other than your Activity are hidden. One can get those those back by swiping down.
Use the following code to achieve this :
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN|View.SYSTEM_UI_FLAG_HIDE_NAVIGATION|View.SYSTEM_UI_FLAG_IMMERSIVE|View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);

Android full screen tablet app

I want to display android app in full screen for tablets.
I thought of using view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); to hide navigation but the problem is that I have buttons in my view. If I hide navigation like this, every time user want's to click butto, on first click the menu shows up but the button isn't clicked.
I wouldn't care if the menu shows or not after click but I don't want users to ask to click twice to choose something.
What would be the suggested way to display my app in full screen?
use this code:
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Just Edit your Manifest.xml file:
Use this code if you want to display all the Activities in Full Screen Mode:
<application
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
...
</application>
Use this code if you want to display some Activities in Full Screen Mode:
<activity
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
...
</activity>
I hope this helps.
You can write this line in Activity on onCreate method :
this.requestWindowFeature((int)Window.FEATURE_NO_TITLE);
SYSTEM_UI_FLAG_HIDE_NAVIGATION will cause those navigation controls to just disappear.There is a limitation: because navigation controls are so important, the least user interaction will cause them to reappear immediately.

On ICS devices Current Activity disappearing when screen gets locked

In activity manifest file i have marked it as android:noHistory="true" because I did not want the screen to be added to the activity stack.
when I lock the screen and unlock it. The activity disappears and the previous screen appears. This should not happen. Please any one can suggest me, how can i handle this on ICS devices. However its working fine on Gingerbread devices.
Remove android:noHistory="true" in android manifest file and call the finish when you move out of that Activity. This will remove the activity completely from the stack and it will not be displayed in your backstack. I hope this will work for you

How to preserve orientation during a popup?

I am using menu in an activity to display a popup window.
The problem is that when the orientation is changed, the popup window disappears and the activity screen is shown again.
(It happens because when the orientation is changed the Activity is started again)
i want that the activity doesnt start again and after orientation change the popup window doesnt vannish.
please chenge activity in manifest file
put in activity below code
android:configChanges="orientation"
Please make the following changes to manifest where you defined your activity
add this lines:
android:screenOrientation="landscape" or
android:screenOrientation="portrait"

Categories

Resources