android-4.0-ice-cream-sandwich

Fragment onHiddenChanged not called

五迷三道 提交于 2019-12-04 22:47:40
I recently added Fragments to my applications. For a new application i'll need to get notified as soon as my fragment is shown. So i can do some calculations as soon as my fragment is shown again. My Fragment is used with a TabIndicator and it's only one FragmentClass which is used a few times. Here's the normal standard override class: @Override public void onHiddenChanged(boolean hidden) { super.onHiddenChanged(hidden); } Still looking for an answer? onHiddenChanged doesn't get called the first time an fragment is shown. Only when it changes state. From the documentation: Called when the

Screen capture using native APIs?

烂漫一生 提交于 2019-12-04 20:38:19
Are there any native APIs (C code) in Ice Cream Sandwich that I can use to capture the entire screen? I need it to be done inside a C program, not using adb or Java interfaces. The androidscreenshot project does exactly that , but you will need to run as root or have your binary signed by the vendor key (i.e. the same key that was used when compiling the OS). There are plenty of discussions about this restriction here and elsewhere on the Internet. 来源: https://stackoverflow.com/questions/10820587/screen-capture-using-native-apis

How can i change the textcolor of my timepicker and datepicker?

北城以北 提交于 2019-12-04 19:54:25
Currently I am working on one of my first applications. In this application I have a TimePicker and a DatePicker . My current Activity has a dark background. Now I want a white textcolor in my TimePicker / DatePicker . In my layout I have defined my pickers: <DatePicker android:id="@+id/dpDateOfValue" android:calendarViewShown="false" /> <TimePicker android:id="@+id/tpTimeOfValue" /> The solution should work on 2.3 - 4.1 Use: <style name="MyHolo" parent="android:Theme.Holo.NoActionBar"> ... <item name="android:editTextColor">#000000</item> </style> to set TimePicker text color for API >= 11

Android app auto reset on minimize

吃可爱长大的小学妹 提交于 2019-12-04 18:38:21
We have designed an hybrid app which is a bit heavy (9 MB). Problem is that at times, minimizing this app (home button) makes the app reset in background i.e. its app cache is lost and app reloads from splash screen. After minimizing we worked with other apps in tablet (Galaxy 800). We saw this problem only if we tried to launch app from the icon in launcher. This problem did not happen when we tried to launch it from the minimized list(recent apps button). This problem is not specific to the tab. It also happened in Galaxy 3 and Droid Razr also. Any guidance? Problem is that at times,

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

纵然是瞬间 提交于 2019-12-04 18:07:25
问题 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. 回答1: You can use Java Reflection to set the global proxy

Android VideoView Error 1,0

别来无恙 提交于 2019-12-04 17:39:23
I have an application thats main goal is to play a specific video file. it plays the video correctly sometimes. But other times it gives me this error: 03-21 14:52:36.181: I/AwesomePlayer(119): setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4') 03-21 14:52:36.196: W/VideoView(26612): Unable to open content: /data/data/my.package.name/files/MyMovie.mp4 03-21 14:52:36.196: W/VideoView(26612): java.lang.IllegalArgumentException: The surface has been released 03-21 14:52:36.196: W/VideoView(26612): at android.media.MediaPlayer._setVideoSurface(Native Method) 03-21 14:52:36.196: W

Color values for Buttons (Normal state) in holo dark theme ICS

自闭症网瘾萝莉.ら 提交于 2019-12-04 17:28:51
Need help regarding the color codes for buttons in HOLO DARK theme ICS. This question throws light into all the color codes for Holo theme except for the buttons in normal state. Thanks in advance. basic buttons holo theme ics. Ive got it now. If you want the default colors of Android ICS; you just have to go to your Android SDK and look after platforms\android-15\data\res\values and then colors. There you go: <!-- For holo theme --> <drawable name="screen_background_holo_light">#fff3f3f3</drawable> <drawable name="screen_background_holo_dark">#ff000000</drawable> <color name="background_holo

Android TabHost Center active Tab

两盒软妹~` 提交于 2019-12-04 17:13:27
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! 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 = 0; i < tabHost.getTabWidget().getTabCount(); i++) { tabHost.getTabWidget().getChildTabViewAt(i)

Login exception SASL authentication failed using mechanism DIGEST-MD5 asmack in android

只谈情不闲聊 提交于 2019-12-04 10:16:45
I m try to connect with Xmpp server,But i m getting exception Login exception SASL authentication failed using mechanism DIGEST-MD5 i use this code ,can any one help me,or code try { if (xmppConnection == null) { ConnectionConfiguration config = new ConnectionConfiguration( SERVER_HOST, SERVER_PORT, SERVICE_NAME); xmppConnection = new XMPPConnection(config); System.out.println("xmppConnection"+xmppConnection); } if (!xmppConnection.isConnected()) { xmppConnection.connect(); System.out.println("Connecting"); } System.out.println("facebook id get xmpp "+username); if (!xmppConnection

On/Off Toggle Button in Preferences & Action Bar - Ice Cream Sandwich Style

ε祈祈猫儿з 提交于 2019-12-04 10:15:36
问题 I am referring to the blue ON/OFF styling as seen in the default Android Settings app on ICS phones. It can also be seen here: http://android-developers.blogspot.com/2012/02/android-design-v2-now-with-stencils.html I want to put them in a Preference screen, would I have to use a custom preference widget? Also, is it easy to put toggle buttons in the Action Bar? It seems to be possible since it is done for Wifi Settings in the default Android Settings on ICS, but it is probably a custom menu