android-4.0-ice-cream-sandwich

Immersive like feature in JB and ICS

无人久伴 提交于 2019-12-10 15:52:52
问题 I am developing an Application where I need to go completely full screen. In kitkat its very easy by using Immersive tag. But since not all devices support kitkat I need to take JB and ICS (atleast) into consideration. Well although there is a way of hiding navigation bar and status bar in JB and ICS it becomes visible as soon as the user interacts. This certainly does not looks good. It also takes one extra touch. I did a lot of searching on net and was surprised that there is no way we can

How to use NumberPicker widget Android 4.0

ε祈祈猫儿з 提交于 2019-12-10 13:00:38
问题 I am trying to configure the NumberPicker widget using API 14 . There are very little tutorials or instructions online that would help me set it up properly. so far I have the following code implemented in main.xml : <NumberPicker android:id="@+id/numberPicker1" android:layout_width="match_parent" android:layout_height="48dp" android:orientation="horizontal" /> and in the main activity in the onCreate() method: NumberPicker np = (NumberPicker) findViewById(R.id.numberPicker1); String[] nums =

Android ICS to JB Actionbar tabs changed requirements

陌路散爱 提交于 2019-12-10 12:18:57
问题 I have an application that targets SDK 15, ICS 4.0.3. I just updated it to point at 4.1 it broke my user interface, and makes it pretty ugly: Here's what it looks like normally on API 15: And here's it on 16 or 17: I got a feeling this is because the Nexus 7 uses the phone UI instead of the actual tablet UI... Is there a way to force the tabs into the actionbar without having to use something like ActionBar sherlock or something else (like subclassing)? Or even if I could make the tabs not

Webview shows white blank page in Ice Cream Sandwitch

懵懂的女人 提交于 2019-12-10 10:36:18
问题 In my webview I have loaded a URL which have an embeded video player of a tv channel live stream. It is working correctly in all the OS version of Android except ICS(4). First time It plays the video well, but when I go back and come again in that page containing the video then the video doesnt loads and shows a blank white page. If I force stop the app from the application setting and start the app again then It runs well then appears white screen again as usual, I have implemented a lot of

Can't get the Android 4.0 Split Action Bar working

左心房为你撑大大i 提交于 2019-12-10 04:33:40
问题 I've followed the development pages on the android dev site, but I cannot get my action bar to split to the top and bottom of the screen. I've got a menu xml defined with a couple of options: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/stop_services" android:icon="@drawable/ic_launcher" android:title="@string/stop" android:showAsAction="ifRoom|withText"/> <item android:id="@+id/start_services" android:icon="

Invalid indirect reference on NewObject call

坚强是说给别人听的谎言 提交于 2019-12-10 03:56:17
问题 OK, so I have the native code below. I'm trying to return an array of FilePermissionInfo from it, populated with some data returned by stat(). The problem is that I get the following error when NewObject is called the first time: 06-15 20:25:17.621: W/dalvikvm(2287): Invalid indirect reference 0x40005820 in decodeIndirectRef 06-15 20:25:17.621: E/dalvikvm(2287): VM aborting It's odd, because the only reference object I have is the jclass (for FilePermissionInfo) and I turn it to a global

Play SWF file in webViewClient on ICS?

非 Y 不嫁゛ 提交于 2019-12-10 02:27:20
问题 I tried to open an SWF file in webViewClient and it works on Android 2.1 and 2.3.3. But when I try to play the same SWF file on 4.0.4, it causes an error and a green screen appears in the videoPlayer page. oWebView = (WebView) findViewById(R.id.wvhPlayer); oWebView.setWebViewClient(new KhWebClient()); oWebView.getSettings().setJavaScriptEnabled(true); oWebView.getSettings().setPluginsEnabled(true); oWebView.getSettings().setAllowFileAccess(true); oWebView.getSettings().setBuiltInZoomControls

Does “Clear Data” also kill the app?

混江龙づ霸主 提交于 2019-12-10 01:42:47
问题 When (in Gingerbread, 2.3.x) I hit “Clear Data” button in Menu => Manage Apps => App, “Force Close” button also becomes disabled. Does it mean that “Clear Data” also kills the app? Also, I noticed that in Ice Cream Sandwich this doesn’t happen. So, the way “Clear Data” works is different between Gingerbread and Ice Cream Sandwich? Update : as MisterSquonk said, Froyo (2.2.x) behaves the same way as ICS (4.x), that is doesn’t disable Force Close after you clear data of the app. Anyone knows

Android TabHost Center active Tab

只愿长相守 提交于 2019-12-09 19:45:14
问题 Is it possible to change Android Tabs that if you press one, it comes to the center of the TabHost. Only 3 Tabs are visible, doesn't matter how many there are. Like in the Android 4.0 Google Music App! If it is, how would you do that? Thank you! 回答1: I did find the answer myself. If somebody else needs it, this should do it: final HorizontalScrollView mHorizontalScrollView; float scale = getResources().getDisplayMetrics().density; final double tabWidth = (int) (150 * scale + 0.5f); for (int i

UTF-8 encoding on WebView and ICS

蓝咒 提交于 2019-12-09 17:59:04
问题 To correctly display UTF-8 text in a WebView , I usually use a doctype and a meta tag : <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> and I use a tip I've seen on Stack Overflow: string = URLEncoder.encode(string, "UTF-8").replaceAll("\\+", " "); That works fine on Gingerbread and older Android versions, but my Nexus S recently received the Ice Cream Sandwich update, and French characters like é , à , è , etc. are displayed like this: é , for example. I don't know if