android-4.0-ice-cream-sandwich

How set ICS theme for application with minSDK 7?

坚强是说给别人听的谎言 提交于 2019-12-03 20:41:43
could anybody tell me how can I set a theme for my application which will change when version of Android will change. For example if anybody will use my app on Android 2.1 theme will look like this: http://daily-money.googlecode.com/svn/wiki/img/prefs.png But if anybody will use my app on for example Android 4.0.3 theme will look like this: http://img.tapatalk.com/dcff019c-27ba-1e1a.jpg I have used minSDK 7. Thank you. What you want is detailed in on this page: http://android-developers.blogspot.com/2012/01/holo-everywhere.html In the section titled "Defaults for Older Apps" You setup 2 theme

Why is Android 4.0 / Ice Cream Sandwich allocating so much heap memory?

亡梦爱人 提交于 2019-12-03 17:02:49
问题 I noticed that on my Galaxy Nexus that android.content.res.Resources is allocating about 11MB. I discovered this as I was in the process of profiling things using DDMS and the " Dump HPROF file " option. So, I spent two hours trying to see if the allocation was due to something in my code or supporting libraries. I removed all my data, a ton of classes, all my libraries, and saw no change. After placing a breakpoint in my code at the beginning of the onCreate() method of the activity, it

Android 4.0 Eclipse compilation failed

跟風遠走 提交于 2019-12-03 16:46:50
Today I switched to Android 4.0 for app developent using Eclipse. After upgrading I get the following exception. Any ideas? Some blog entries mentioned to remove the Android library from the Eclipse project update the project configuration, but this does not work. [2011-10-27 22:29:27 - ...] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class (org.apache.commons.logging.impl.LogFactoryImpl$1) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended

Android Action Bar: Changing the color of Action Buttons

最后都变了- 提交于 2019-12-03 16:21:24
I have an app with an action bar that looks like this: I would like the text of the menu action buttons "Home" and "Logout" to be white as well. How can I change their text color? Let me know if you want to see any code. Thanks! As i perceive it this is a simple attribute called android:actionMenuTextColor . To use it properly you should create your own styles, like this: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="myTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionMenuTextColor">@color/actionBarText</item> </style> <style name="myTheme.ActionBar"

How do I target 1280x720 WXGA720 resolution (like new Galaxy Nexus) in Android Layout folders?

柔情痞子 提交于 2019-12-03 15:19:58
When testing my application at WXGA720 resolution on the Android Emulator running 4.0.3 Ice Cream Sandwich, my app takes the layout assets from the layout-normal-land-854x480 folder in landscape view and the layout-port-480x320 folder for portrait view. I would like to be able to specifically target this resolution so my app displays properly on the new phones. How do I do this? I have tried the following... layout-normal-land-xhdpi layout-normal-port-xhdpi layout-normal-land-xlarge layout-normal-land-large layout-normal-land-1280x720 layout-normal-port-1280x720, etc... ...and it still takes

WebView inside ViewPager or ScrollView - weird rendering bug on Android 3.0+

早过忘川 提交于 2019-12-03 13:02:42
I have a ViewPager. Every page of the ViewPager is a ScrollView. The ScrollView contains a WebView and several other Views. On Android 2.3 and older everything works fine but on 3.0+ there's a weird rendering issue: When scrolling left / right in the ViewPager, there is also a very subtle rendering issue (which is present in Android 4.0 Gmail app too). This might be related to hardwareAcceleration. Try specifically turning it off. You can do this 1) in the application tag inside your manifest (which will disable hardware acceleration throughout the app) android:hardwareAccelerated="false" OR 2

Settings.Secure.HTTP_PROXY deprecated in ICS but no information on replacement

纵然是瞬间 提交于 2019-12-03 10:54:22
The Android developer docs say the following about Settings.Secure.HTTP_PROXY : Host name and port for global http proxy. Uses ':' seperator for between host and port TODO - deprecate in favor of global_http_proxy_host, etc But there is not any information about global_http_proxy_host . Now I always get null when trying to read Settings.Secure.HTTP_PROXY . Settings.Secure.HTTP_PROXY was working properly in all releases before ICS. You can use Java Reflection to set the global proxy tested on ICS. UPDATED CODE Activity activity = this; private void setProxtAndPortOnICS(String porxyServer2, int

ErrnoException: isConnected failed: EHOSTUNREACH (No route to host) when changing the wifi network using ICS

回眸只為那壹抹淺笑 提交于 2019-12-03 10:40:37
When using my app on ics, after I change my wifi network from networkA to networkB all the requests for images start coming back with an exception. failed with exception > org.apache.http.conn.HttpHostConnectException: Connection to > https://m1.testapp.com refused at > org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:183) > at > org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) > at > org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) > at > org.apache.http.impl

smoothScrollToPosition() only scrolls partway in Android ICS?

烈酒焚心 提交于 2019-12-03 10:10:43
问题 In Gingerbread, I had no issues with using smoothScrollToPosition() to scroll across dozens of items at a time. After my Nexus S was upgraded to Ice Cream Sandwich, I noticed that no matter what I put in smoothScrollToPosition(), it will only scroll about a couple of hundred pixels in either direction, and then stop. Is this a known issue with ICS? I've noticed this with the Galaxy Nexus as well. I've looked at a few other questions and tried a few different tricks, such as turning off calls

Android not acknowledging TTS Engine

泪湿孤枕 提交于 2019-12-03 09:40:54
问题 I am developing a very simple app in here. It's for my Cerebral Palsy daughter. It's just a big YES and NO buttons, so she can press them when requested. Well... I am using SVOX Classic TTS Engine. Everything was running smoothly until my tablet upgraded to ICS. Now, everytime I run the app, it opens the Market asking for me to install TTS. I hit "back" and then, my app speaks. This is VERY annoying. Here is what Google API says: *A successful check will be marked by a CHECK_VOICE_DATA_PASS