I've developed a navigation drawer for my app, but the toggle button is shown in white. This is my image for the button
And this is how it is shown on my app
Does anyone know why this happends?
You just make sure your app theme If you having your Theme like black you just apply this theme in your Application Mainfest file
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.Holo.Light" >
......
....
</application>
Afterwards you are getting the same pblm you just make sure in your drawable folder image is like your gray color image or not...
Related
Can someone explain what is happening here. I load a blank Activity and two xml files are created in Android Studio; the content_main.xml, which contains all of my widgets, and activity_main.xml, which includes my contents file and looks like this:
I don't want to use this Toolbar so I delete it. Now the activity_main.xml file looks like this:
I still want to have an actionBar however. My manifest file, clearly references a theme in my styles folder:
And here is is the styles.xml file, which sets a theme for the Action Bar:
How come, when I start the emulator, my action bar is missing? My main_activity extends AppCompatActivity. Any idea why this is happening?
you are activity is overriding the Application's theme and using the NoActionBar theme. Get rid of android:theme from the <activity tag
Change from
<activity
android:theme="#style/AppTheme.NoActionBar"
android:name=".MainActivity"
android:label="#string/app_name">
to
<activity
android:name=".MainActivity"
android:label="#string/app_name">
I am building an Android app. In this app I have added a launcher icon (to be used as an app icon) but I also using another icon to be used in the actionbar on all activities. The activity icon got a transparent background color but the application icon is using a solid color background.
The problem is that when I install the app the application is using the activitity icon instead of the launcher icon. The problem with this is that the app icon get a transparent background color instead of a solid one.
What is wrong?
This is my manifest code for the application:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:name="com.example.dev.MyApplication"
android:theme="#style/Theme.Example" >
This is the manifest code for one of the activities (the are all the same):
<activity
android:name=".ui.TasksDetailsActivity"
android:icon="#drawable/ic_menu_logo"
android:screenOrientation="portrait"
android:label="#string/title_activity_tasks_details" >
</activity>
The app is using the ic_menu_logo (transparent) instead of the ic_launcher (solid color) icon when installing the app.
Don't use "android:icon". Use "android:logo" instead:
<activity
android:name=".ui.TasksDetailsActivity"
android:logo="#drawable/ic_menu_logo"
android:screenOrientation="portrait"
android:label="#string/title_activity_tasks_details" >
</activity>
I'm wondering why, every time I create a new Android project, Eclipse opens a main activity with a white background, when in previous versions, it was black.
Is there any way for me to change that back to black as a default color for future activities?.
They changed the default theme that eclipse uses in your resources to the light theme. Change your resource files (delete the stuff eclipse added that you don't use) and it will go back to black.
So if you want to reskin your whole application to black, you can use following line in your manifest file.
Write to Application tag attribute theme.
<Application
android:theme="#android:style/Theme.Black" //old targeted application
OR
android:theme="#android:style/Theme.Holo" //for new devices
... >
Now all activities in this application have black theme.
You can "override" this by using theme attribute in Activity tag.
<Activity
android:theme="some theme"
...>
Would it be possible to set the logo and launcher icon dynamically rather than specifying in the manifest
<application
android:icon="#drawable/ic_launcher"
android:logo="#drawable/app_logo"
android:label="#string/app_name"
android:hardwareAccelerated="true">
Call setIcon() and setLogo() on ActionBar to change them at runtime.
EDIT: Works from API level 14 on.
I am using following code to replace title bar.
final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
And it's working fine once UI loaded. Problem is however when I start the app, the ugly gray bar appears for 1-2 seconds until UI loaded. Is there any way to specify not showing the default title bar at all?
If you want the titlebar to be gone in every activity within your app, then add
<application android:name=".YourAppNameHere"
android:label="#string/app_name"
android:icon="#drawable/icon"
android:theme="#android:style/Theme.NoTitleBar">
to your manifest. Not 100% sure though that this will prevent the titlebar from showing up momentarily, but it should work.
In the Manifest file, add this line inside the application tag
android:theme="#android:style/Theme.NoTitleBar"
It will hide the bar from all the activities. If you want to hide it from a specific activity, add the same line to that activity's tag.
Good Luck !
You should add a line to your AndroidManifest which states that you use a theme (standard android or extended)
<application android:name=".YourAppNameHere"
android:label="#string/app_name"
android:icon="#drawable/icon"
android:theme="#style/MyTheme">
and then you can have a themes.xml in your res/values/ folder where you extend the: Theme.NoTitleBar and add custom rules to them (for example like windowBackground)
<resources>
<style name="MyTheme" parent="android:Theme.NoTitleBar">
<item name="android:windowBackground">#drawable/my_background</item>
</style>
<resources>
Have fun