android-4.0-ice-cream-sandwich

Android - html from android_assets in WebView, CSS not loading in ICS

扶醉桌前 提交于 2020-01-24 03:25:09
问题 I've been writing a small app that basically loads its content from locally stored HTML and CSS into a WebView. I initially started this when I had a device running Android 2.3 and had no issues. I recently got a Galaxy Nexus but the CSS doesn't appear to load in ICS. I read something that suggested enabling hardware acceleration would help but it does nothing. I'm now at a complete loss. Javascript seems to load fine so, combined with it working well on 2.3, suggests it's not the way I'm

Set textview fading in Android 4.0.3

你。 提交于 2020-01-22 21:01:48
问题 I've just tried to implement the fade effect for TextView in Android 4.0.3; however, it doesn't work. fadingEdge="horizontal" singleLine="true" ellipsize="marquee" This code works perfectly for 2.3.7 and below, but not working for 4.0.3. I'm wondering why is that so? and how to make fade effect for TextView ? My question is the same as this one: http://groups.google.com/group/android-developers/browse_thread/thread/97131b20de8b2ebd , but no answer yet. 回答1: It is a bit late, but that may help

Set textview fading in Android 4.0.3

时间秒杀一切 提交于 2020-01-22 21:01:32
问题 I've just tried to implement the fade effect for TextView in Android 4.0.3; however, it doesn't work. fadingEdge="horizontal" singleLine="true" ellipsize="marquee" This code works perfectly for 2.3.7 and below, but not working for 4.0.3. I'm wondering why is that so? and how to make fade effect for TextView ? My question is the same as this one: http://groups.google.com/group/android-developers/browse_thread/thread/97131b20de8b2ebd , but no answer yet. 回答1: It is a bit late, but that may help

How to keep expanded SearchView on the right side of ActionBar (while using custom icon)?

丶灬走出姿态 提交于 2020-01-20 04:58:04
问题 My question is closely related to SearchView wrong alignment and SearchView positions when expanded in ActionBar but the answers posted there do not work. So, I'm using a SearchView in the Action Bar: <item android:id="@+id/action_search" android:icon="@drawable/navi_search" android:title="@string/action_search" android:showAsAction="ifRoom|collapseActionView" android:actionViewClass="android.widget.SearchView" /> It looks like this by default (top-right corner, next to overflow menu):

Real Fullscreen with Android 4 Tablets

瘦欲@ 提交于 2020-01-15 06:51:08
问题 i'm searching for a solution to make a tablet with ICS to fullscreen without navigation bar. I have found an app "GestureControl" that make that possible. But there are some other things in this app that I doesn't need. So I think it is possible. I tried some things with "FLAG_FULLSCREEN" or " SYSTEM_UI_FLAG_HIDE_NAVIGATION" but it doesn't work. Maybe I use it not correctly. Have anyone a solution for my problem? Much thanks. 回答1: You cannot hide the system bar on Android tablets, except

Null pointer Exception: GestureDetector.onTouchEvent for custom gallery in android for ICS 4.0

試著忘記壹切 提交于 2020-01-13 17:07:28
问题 In one of my android app, I am using custom gallery to show images in gallery . (I am using custom gallery in order to show 1 item a time when swapping the gallery) Here is the code that I am using for custom gallery : public class CustomGallery extends Gallery { public CustomGallery(Context context) { super(context); } public CustomGallery(Context context, AttributeSet attrs) { super(context, attrs); } public CustomGallery(Context context, AttributeSet attrs, int defStyle) { super(context,

Custom switch widget in Android 4

放肆的年华 提交于 2020-01-13 09:48:06
问题 I am getting crazy with switch buttons in Android 4. First of all, I have set a selector as background with two different PNG files selected from drawable folder: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/form_switch_no" android:state_checked="false"/> <item android:drawable="@drawable/form_switch_ok" android:state_checked="true"/> <item android:drawable="@drawable/form_switch_no"/> </selector

Set a VPN connection programmatically on android 4.0

青春壹個敷衍的年華 提交于 2020-01-11 15:23:07
问题 I'm working on programmatically setting a VPN connection on android devices. I was successfully able to do so for devices using OS 2.3.5 and before (I used reflection to get to the hidden classes). But with android 4.0 they got rid of the old classes and use the VPNService class instead. I figured the best place to start would be to use the ToyVPN example android provided, but I'm facing a lot of challenges with it. In the example code they only needed to send the server address:

Options menu not showing in ICS using compatibility library

情到浓时终转凉″ 提交于 2020-01-11 04:19:45
问题 I can't get an options menu to show in a Fragment in ICS in a project which uses the android-support-v4.jar library. I'm testing on a Galaxy Nexus handset. We aren't using the action bar, and need the app to be 2.2+ compatible. We aren't seeing any options menu in the activity in ICS (the FragmentActivity doesn't support onCreateOptionsMenu) I can get menus working in previous version of Android - I have all the correct framework to enable the options menu (as below) but nothing shows in ICS.

What is triggering this Exception instance: “java.lang.IllegalArgumentException: The observer is null.” and how could it be avoid?

不问归期 提交于 2020-01-10 08:32:21
问题 I'm getting this exception when returning to the original ListActivity after opening an new activity with the content of the item selected by the user. It only occurs on Ice Cream Sandwich. This is the trace: java.lang.IllegalArgumentException: The observer is null. at android.database.Observable.unregisterObserver(Observable.java:59) at android.widget.BaseAdapter.unregisterDataSetObserver(BaseAdapter.java:42) at android.widget.AbsListView.onDetachedFromWindow(AbsListView.java:2373) at