How can I solve the following issue? What I would like to happen is for the input window to be displaced, not squeezed, by the soft-keyboard.
Add android:windowSoftInputMode="adjustPan" to your activity tag in your AndroidManifest.xml
Related
when I create a new activity, Android Studio show me this photo:
It have a Back button but activity haven't it. how can I Make visible it?
put getSupportActionBar().setDisplayHomeAsUpEnabled(true); into onCreate() method in your activity class
In manifest declare the activity as a parent activity to get this button like this
<activity android:name="com.owletogroceries.activity.RewardsActivity"/>
<activity android:name="OrderConfirmationActivity"
android:parentActivityName="ProductActivity"/>
I have a screen in my app with a button to set date/time in the OS. I use startActivity(new Intent(android.provider.Settings.ACTION_DATE_SETTINGS)) to open the android's date/time screen .
After setting the date/time , i return to my app screen using the back button in the android's status(notification) bar. After this, the notification bar never dissappears from my app screens. Its persistent until i restart my application. Is there a way to remove the notification bar?
I have added the line "android:theme="#android:style/Theme.NoTitleBar.Fullscreen" to all my activities and even at at the application level(just inside )
But still it never goes
Here is a part of my manifest
<activity
android:name="com.cyberonics.progsoundapp.ui.AlarmSettingScreen"
android:configChanges="keyboardHidden|orientation"
android:label="#string/title_activity_alarm_setting_screen"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
I also have the following code in my activity class
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN) before SetContentView()
Is there anything else i am missing?
Request your guidance on this
Thank you
I am new to Android and I copied a sample code from web and build my app on that sample code. But I am trying to delete the image on the top toolbar. I cannot locate where the program puts that image.
here is the screen. I put a red mark on the toolbar I am talking about and I want to remove that smily face on that bar. but I dont want to delete the image, I want to find the code which puts that face there.
That will be located in your manifest file under the <application> tag. Here is an example:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
Now each of the ="#somewhere/name" is a pointer. The icon is under res/drawable, while the other two will be under res/values/
You can use the following code. You must add in the onCreate() method of your activty :
getActionBar().setDisplayShowHomeEnabled(false);
I would like to create android options menu (left button on android device) looking like this one:
but using onPrepareOptionsMenu creates the menu which looks like this one:
Could you please point me how to change the look of the menu? Is there anything I can set in menu XML to change it's look or maybe I should use: onPrepareContextMenu?
Thanks in advance for your reply.
Add
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
attribute to the <activity> tag in project's AndroidManifest.xml
<activity android:name="YourActivity"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
>
In my app, in the OnCreate method, I create a list(using an add button) or I fetch it from a saved file. My function works fine and I am able to create and fetch the list until I rotate the phone(vertical -> horizontal). The list then disappears. I am still able to click the buttons on screen, but it seems I have no items in the list.Any help appreciated. Thank You in advance.
add this tag in Activity tag in manifest
android:configChanges="keyboardHidden|orientation"
and add this in activity code
#Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
in the same activity..
this happens because each time your screen orientation is changed onCreate() method of the Activity will be called every time
This post from developer.android.com could help too!
It would be wise if you would add screenSize at android:configChanges="keyboardHidden|orientation" aswell i.e
android:configChanges="orientation|keyboardHidden|screensize"