android-4.0-ice-cream-sandwich

Android ICS emulator camera

跟風遠走 提交于 2019-12-05 12:13:44
问题 I am trying to get a look at the Gallery application in ICS, using the emulator. So, I launch an AVD and snap a couple of pictures with the Camera then launch the Gallery. When I click any collection in the Gallery, I get an error, "Unfortunately, the camera has stopped". The Gallery application quits. I've tried this on Mac and Windows. Same thing. Anyone know how to make this work? 回答1: You need to make sure that your AVD has the camera enabled prior to starting the application. In Eclipse

onScrollChanged() never fired on Android 4.0

我们两清 提交于 2019-12-05 09:21:39
I have a GridView that shows images from your gallery. When user scrolls the list, details about the image animate in from the left. I implemented this in the class that defines custom layout for the GridView item. It extends LinearLayout . OnScrollChangedListener mScrollListener = new OnScrollChangedListener() { @Override public void onScrollChanged() { if (!getGlobalVisibleRect(r)) { resetAnimation(); } else { if (checkBounds()) { showInfo(); } } else { hideInfo(); } Method resetAnimation() resets the animation if it's view is not visible on screen. Method checkBounds() compares the Rect got

Android 4.0 custom notification like google music

↘锁芯ラ 提交于 2019-12-05 08:31:34
I want to create a custom notification with a progress bar and a delete button. Screenshot: I succeed to create a custom notification with a progress bar, but I did not manage to create the delete event. I want to cancel the notification and stop the upload once the user click on the "x" (as in google music, so i don't want to start an activity to clear the notification). Here is my working code : notificationManager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE); int icon = R.drawable.ic_launcher; CharSequence tickerText = "Hello"; long when = System

Can't get the Android 4.0 Split Action Bar working

醉酒当歌 提交于 2019-12-05 08:23:07
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="@drawable/pushpin" android:title="@string/start" android:showAsAction="ifRoom|withText"/> </menu> In my

Gradient compatibility issue - ICS defaults to fewer colors than all the previous versions of Android

谁都会走 提交于 2019-12-05 05:24:57
Gingerbread (2.3.3) emulator left, ICS (4.0.3) emulator right. Notice the gradient fade effect difference inside the red box (open in separate window to see the full sized image). Mainview background: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/app_bg" android:orientation="vertical" > ... </LinearLayout> app_bg.xml <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#000" android:centerColor="

Invalid indirect reference on NewObject call

落花浮王杯 提交于 2019-12-05 05:10:45
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 reference. The code is: JNIEXPORT jobjectArray JNICALL Java_com_mn_rootscape_utils_NativeMethods

Long text goes to next line on ICS, but not on GB and below

爱⌒轻易说出口 提交于 2019-12-05 04:18:41
The first time I noticed this was with AlertDialogs putting the entire message on the first line, even when I specified a new line("\n"). On ICS it displays the correct way, but for the life of me, I couldn't get it to work on GB. Recently I've run into it again. I don't see any reason for it working fine on ICS but not GB and below. EXAMPLE Project Heres an example project with a textview, alertdialog, and two standard textviews. https://github.com/T3hh4xx0r/Text-Example EDIT Heres the original question I asked. Seems the problem is more than I originally noticed though. Android AlertDialog

Android Action Bar: Changing the color of Action Buttons

旧街凉风 提交于 2019-12-05 01:07:10
问题 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! 回答1: 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">

Android 4.0 Eclipse compilation failed

百般思念 提交于 2019-12-05 00:57:57
问题 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

Adding a ProgressBar to a ListView/OnClick called a single time

*爱你&永不变心* 提交于 2019-12-05 00:10:04
问题 The idea is to have a list of items where after clicking an item, a ProgressBar will slowly fill as the task is completed. For example, picture a list of files, with a Download button by each one. When the download button is clicked, the file is downloaded in the background and a progress bar is filled showing how close the file is to completion. To accomplish this, I create an AsyncTask which occasionally calls notifyDataSetChanged on the adaptor to redraw it. While this works after one