android-4.0-ice-cream-sandwich

Failed looking up window - different behaviors from same app on 2 galaxy nexus

筅森魡賤 提交于 2019-11-30 13:51:13
I have two Galaxy Nexus phones. The phones are the same firmware version 4.0.2, same build number, same kernel version. When I deploy the same exact app to both of the phones using Eclipse, I see different behaviors from each. On one phone, everything works as expected. On the other phone, the main Activity crashes when switching to another activity and back to the main one, both by back button and by other activities finishing and returning to the activity that created it. The only clue I have to this problem is this error: 04-18 17:43:30.811: I/ActivityManager(207): Displayed org.mitre

Android Toast notification is too small in Ice Cream Sandwich [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-11-30 13:24:11
问题 This question already has answers here : Toast size on Galaxy Nexus (4 answers) Closed 6 years ago . Has anyone had any problems with the Toast Notifications in Ice Cream Sandwich being too small? In my application, the notifications look fine on all other versions. In Ice Cream Sandwich, however, its incredibly tiny. At first I thought that it might be my custom theme but, after disabling it, I saw the same results. I am displaying a Toast just like everyone else with: Toast.makeText

PACKAGE_ADDED BroadcastReceiver doesn't work

廉价感情. 提交于 2019-11-30 12:51:36
问题 I have a broadcast receiver registered in Manifest: <application ...> <receiver android:name="com.some.pkg.NewAppReceiver" > <intent-filter> <action android:name="android.intent.action.PACKAGE_ADDED" /> </intent-filter> </receiver> </appcication> And the receiver: public class NewAppReceiver extends BroadcastReceiver { private static final String TAG = "NewAppReceiver"; @Override public void onReceive(Context context, Intent intent) { Log.d(TAG, "Intent: " + intent.getAction()); } } And

Change ListView choiceMode from singleChoice to multipleChoiceModal

亡梦爱人 提交于 2019-11-30 12:43:26
I have a ListView that normally is the singleChoice choiceMode . When the user long presses on an item, I want to enter an action mode that allows selecting multiple items so they can perform an action on any selected items. I am able to configure the ListView so that it is in singleChoice mode and the user is able to select list items to display a details fragment next to it and have the list item itself shown in its activated state. I am also able to configure the ListView so that it is in the multipleChoiceModal choiceMode and performing a long press on an item starts the action mode and

Get the real screen resolution on Ice Cream Sandwich

点点圈 提交于 2019-11-30 12:35:12
Devices with Ice Cream Sandwich can use on-screen soft keys, and this means that some of the screen estate is taken by these keys. I need to get the real screen resolution, and not the resolution minus the space taken up by the soft keys. I've tried the following, but neither works: Display display = getWindowManager().getDefaultDisplay(); int width = display.getWidth(); int height = display.getHeight(); Log.d("SCREEN RES", "Width: " + width + ". Height: " + height); DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); height = metrics

How to record the video using camera preview on TextureView

北战南征 提交于 2019-11-30 12:08:09
I have been playing with TextureView on some Android 4.0 devices. For example, I tried to develop a simple app, which can record the video and uses TextureView for its preview. However, as far as I read the Android API documents, standard MediaRecorder requires certain surface in order to perform video recording, but on the other hand, TextureView does not have its own surface anymore, so an incompatibility between TextureView and MediaRecorder seems exist. MediaRecorder.setPreviewDisplay TextureView Does anyone know how to record video using standard MediaRecorder with TextureView as its

Parsing data from hdp device for android (API 15)

大憨熊 提交于 2019-11-30 10:38:43
I am using the HDP Sample and I have a Blood pressure sensor (http://www.andonline.com/medical/products/details.php?catname=&product_num=UA-767PBT-C). I get the data from it, but I don't know how to parse it into something human readable. this is what I tried until now with something like: while(fis.read(data) > -1) { String value = null; BigInteger bi = new BigInteger(data); // for(byte b:data){ // value+=b; // } Log.d("read data binary", "the data "+bi.toString(2)); Log.d("read data decimal", "the data "+bi.toString()); Log.d("read data hexa", "the data "+bi.toString(16)); Log.d("read data

Android Ice Cream Sandwich Edittext: Disabling Spell Check and Word Wrap

二次信任 提交于 2019-11-30 10:28:24
问题 Whilst testing on the Android Emulator running Android 4.0 (Ice Cream Sandwich), I have noticed that the Edittext does some quite strange things. Firstly, it underlines every word identified as "misspelt" in red. How do I disable this? Secondly, although in the layout XML I have specified android:scrollHorizontally="true" word-wrap is enabled: how do I disable this as well? Here is the Layout XML code for the Edittext: <EditText android:id="@+id/editor" android:layout_width="40dp" android

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

穿精又带淫゛_ 提交于 2019-11-30 09:21:44
问题 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

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

二次信任 提交于 2019-11-30 07:51:26
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" > <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="15" /> <application android:icon="