android-4.0-ice-cream-sandwich

listview gets out of memory exception, but with no memory leaks?

前提是你 提交于 2019-11-29 14:55:26
After Honeycomb, Google said that bitmaps are managed by the heap (talked about here ), so if a bitmap is no longer accessible, we can assume that GC takes care of it and frees it. I wanted to create a demo that shows the efficiency of the ideas shown for the listView lecture (from here ), so I made a small app. The app lets the user press a button, and then the listview scrolls all the way to the bottom, while it has 10000 items, which their content is the android.R.drawable items (name and image). For some reason, I get out of memory even though I don't save any of the images, so my question

BroadcastReceivers in ICS

扶醉桌前 提交于 2019-11-29 14:17:03
I had written a small utility app just for my phone, which stopped the annoying carrier provided jingle which played on boot up. I noticed the sound didn't play if I put the phone into silent mode before powering off, so I wrote this little utility to go silent on power down and restore sound on boot. This worked well for a Galaxy S2 on Gingerbread. The entire code is in two classes: public class OnShutDownReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { AudioManager mgr=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE); mgr

“Ice Cream Sandwich” and WRITE_APN_SETTINGS

半城伤御伤魂 提交于 2019-11-29 10:59:19
Does anybody know how to write app for " Ice Cream Sandwich " using WRITE_APN_SETTINGS permission ? WRITE_APN_SETTINGS is now ignored in ICS and code touching APNs fails. Yes, Google high handedly decided to remove this. No dialogue comes up for confirmation, they simply make it fail. Thanks for acting like Apple! This ruins the user experience for users of non standard APNs (I'm on giffgaff which Google decided not to put on the official ICS list, once again, thanks). So I had to enter all the settings by hand. Think of all the users who simply wouldn't have a clue, this is insane. You might

No resource identifier found for attribute 'parentActivityName' in package 'android'

时间秒杀一切 提交于 2019-11-29 10:37:38
问题 I'm trying to complete this tutorial from the Android Page http://developer.android.com/training/basics/firstapp/starting-activity.html But I Eclipse throws this error: "No resource identifier found for attribute 'parentActivityName' in package 'android'" I have included the android-support-library. Here is the whole AndroidManifest.xml code <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myfirstapp" android:versionCode="1" android:versionName="1.0" >

IllegalArgumentException thrown by requestLocationUpdate()

强颜欢笑 提交于 2019-11-29 09:54:34
We recently tested our application against android API level 14 and 15. We started development targeting minimal SKD Version 8 and excluding tablets (3.x). With 2.x everything works well but when running the app on a 4.x droid it crashes at the point we're obtaining user's location. FATAL EXCEPTION: main java.lang.RuntimeException: Unable to create service java.lang.IllegalArgumentException: provider=network at android.app.ActivityThread.handleCreateService(ActivityThread.java:2263) at android.app.ActivityThread.access$1600(ActivityThread.java:123) at android.app.ActivityThread$H.handleMessage

Embedded Google Map can't get current location in WebView

独自空忆成欢 提交于 2019-11-29 07:17:05
I followed this tutorial: http://android-er.blogspot.com/2013/03/embed-google-map-in-webview.html I'm trying to just use the Google Map in the WebView, but it can't get my current location. I've enabled JavaScript on the WebView. What else do I have to enable? Does anyone know why that might be? Shouldn't it prompt me to use my current location? Note that I am not interested in using a MapView as an alternative whatsoever. I'm trying to find out what I need to set on the WebView or maybe on the device's location services? You should permit the web view to access your location by overriding the

Program different layouts for different versions in android

六月ゝ 毕业季﹏ 提交于 2019-11-29 06:53:30
I have to program my Android app with the best compatibility to different screen sizes (tablets and smartphones) and to the versions 2.3, 3.2 and 4.0. I know about the possibliy to name the folders of the layout like res/layout-sw600dp/. to match the layout exactly to different screen sizes. So, cause I will use completely different layouts for Tablets / Smartphones , I would start with a "Load Screen", which tests which Android-version is used and if there is used a tablet-or smartphone-device, cause for example in the layout for the Tablet, there will be Buttons on some screens that won't be

Tab widget have always in capital alphabets in android 4.0

江枫思渺然 提交于 2019-11-29 03:51:46
In Android 4.0 i put tab bar with two widget. in code i write in small alphabates(new) but in application it should always display (NEW) How to write small alphabates on tab in android 4.0 The default theme for tab views in Android 4.0 (the Holo theme) has android:textAllCaps set to true. You can create your own theme and then apply it to the action bar in your manifest to override this behavior. For more information on styling the ActionBar and creating your own styles, see: http://developer.android.com/guide/topics/ui/themes.html and http://android-developers.blogspot.com/2011/04/customizing

setColorFilter() broken on Android 4, working on Android 5

岁酱吖の 提交于 2019-11-29 03:31:25
问题 I am trying to flash different colours onto the screen at regular intervals (a few times per second). To change the colours, I use Drawable.setColorFilter(int color, Mode mode) on the background of my main view: myView.getBackground().setColorFilter(Color.RED, PorterDuff.Mode.SRC); For debugging purposes, I added another view that I change using View.setBackgroundColor(int color) . The problem is that the setColorFilter() calls are working on Lollipop , but are broken on previous versions

android EditText blends into background

无人久伴 提交于 2019-11-29 02:18:37
My app uses Theme.Holo.Light.DarkActionBar as the parent theme. When I use my Android 3.2 tablet emulator, the EditText shape is almost impossible to see. It looks like it is trying to draw white on white. Seen here: When I use it on my Android 4.0 tablet emulator, the EditText shape looks just fine. You can see the dark grey line along the bottom of the EditText. If you look in the above image, you'll just barely see a white line in the same place as it crosses the light grey background watermark. Here is my EditText in the layout: <EditText android:id="@+id/fieldName" style="@style