android-3.0-honeycomb

Change colour of activated list item background on Honeycomb

懵懂的女人 提交于 2019-12-18 10:56:18
问题 For Honeycomb, I have set my listview items to use the ?android:attr/activatedBackgroundIndicator style so they remain highlighted when selected. How do I change the colour of the highlight? 回答1: Define a custom theme with the item: <item name="android:activatedBackgroundIndicator">@drawable/my_background</item> Next, declare that drawable in a state list .xml file under res/drawable/my_background.xml as illustrated here: http://developer.android.com/guide/topics/resources/drawable-resource

How to get screen resolution in Android Honeycomb?

会有一股神秘感。 提交于 2019-12-18 10:51:20
问题 I want to get real resolution of screen on Android Honeycomb. Here's my code Display display = getWindowManager().getDefaultDisplay(); int w = display.getWidth(); int h = display.getHeight(); My device is Asus Transformer TF101 with size are 1280x800. But above code make w = 1280 and h = 752 (That i want is 800 not 752). I know h < 800 because it's subtracted for status bar. Have any way to get real height of screen? Many thanks! 回答1: Starting Andorid 3.2, the height of system status bar is

Honeycomb and TabHost specs

不想你离开。 提交于 2019-12-18 08:50:10
问题 I have a question about Honeycomb's backward compatibility. I have an app that supports 2.1 or higher and seems to mostly work on Honeycomb except when they start a TabActivity. In particular, when I add tabs to the TabHost, I get the following exception android.content.res.Resources$NotFoundException: Resource ID #0x0 When looking at the code that throws this exception, I see that it's the tab spec that has a label and an icon. Inside the code, in the LabelAndIconIndicatorStrategy tries to

Intent.ACTION_USER_PRESENT not received on HoneyComb or ICS (Samsung) devices

对着背影说爱祢 提交于 2019-12-18 08:29:28
问题 I have a BackgroundReceiver set up to receive the android.intent.action.USER_PRESENT in the manifest file as per: <receiver android:name="com.demo.MyBroadcastReceiver"> <intent-filter> <action android:name="android.intent.action.USER_PRESENT" /> </intent-filter> </receiver> My overridden onReceive(Context, Intent) method is very simple: @Override public void onReceive(Context context, Intent intent) { if (intent != null) { if (Intent.ACTION_USER_PRESENT.equals(intent.getAction()) { // wrapper

Android 3 - Adding a Fragment to a LinearLayout: fill_parent does not work

三世轮回 提交于 2019-12-18 04:36:11
问题 I am trying to add a fragment programmatically to a LinearLayout, but the fragment does not stretch its content across the whole layouts height. It acts like wrap_content instead of fill_parent. On the other side the fill_parent works on the fragment's width. How can I change this behaviour? DashboardActivity: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"

Is possible install Eclipse IDE in a Galaxy Tab?

我与影子孤独终老i 提交于 2019-12-18 02:02:10
问题 Since Eclipse can run in Linux and this tablet has the new Honeycomb (Linux Kernel), can Eclipse IDE run in Android Honeycomb ? I know that isn't pretty much comfortable coding in a tablet, but I'd want to use for UML modeling. 回答1: Android (despite its Linux roots) is far from capable of running Eclipse IDE as is. Not only is the hardware inadequate for supporting such a large application, but Android lacks a full Java SE JVM (Dalvik is a subset) and SWT (Eclipse UI framework) implementation

onCreateOptionsMenu not being called on FragmentActivity when run on phone version

我们两清 提交于 2019-12-17 18:37:39
问题 I create an app that supports both phone and tablet version so i use the android-support-v4.jar library. My activity extends the FragmentActivity and override the onCreateOptionsMenu(Menu menu). This works fine on tablet, the onCreateOptionsMenu being called correctly but it doesn't work on phone, onCreateOptionsMenu never get called. How to resolve this? Note: i use <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="12"/> on Manifest file. 回答1: You should consider from your

Converting input stream into bitmap

纵饮孤独 提交于 2019-12-17 15:39:28
问题 I have problems converting a input stream from web into bitmap. Problem occurs only when input image type is .BMP (bitmap). In that case: bitmapFactory.decodeStream returns null . Any hints how to fix this problem or where should I continue my debugging? Platform: Android (Honeycomb) URLConnection conn = url.openConnection(); conn.connect(); inputStream = conn.getInputStream(); bufferedInputStream = new BufferedInputStream(inputStream); bmp = BitmapFactory.decodeStream(bufferedInputStream);

Android Create custom SearchView Search action

夙愿已清 提交于 2019-12-17 15:35:47
问题 In my application I am using the Action Bar with a custom SearchView in it. I want to use some custom code when the user hits the enter button in the search field. But I cant find a way to catch the moment the user hits the enter button in the SearchView. Now I tried several ways to capture the search action but I cant seem to find it. My button is defined like this: <item android:id="@+id/action_bar_search" android:title="Search" android:icon="@drawable/ic_menu_search" android:showAsAction=

Honeycomb notifications - How to set largeIcon to the right size?

两盒软妹~` 提交于 2019-12-17 15:34:40
问题 I find myself curious why the setLargeIcon method on Notification.Builder only accepts a Bitmap, with no overload to provide a resource id. Perhaps it was done for performance reasons, but it seems odd as setSmallIcon does accept a res drawable id. Notification.Builder builder = new Notification.Builder(application); // .... builder.setLargeIcon(iconBitmap); // Requires a Bitmap builder.setSmallIcon(iconResId); // Requires a drawable resource ID Notification notification = builder