android-3.0-honeycomb

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

拟墨画扇 提交于 2019-11-29 06:02:24
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" android:orientation="horizontal" > <fragment android:id="@+id/fragment_dashboard" android:layout_width=

What to do about ListActivity/MapActivity when converting to Fragments using the compatibility library?

谁说胖子不能爱 提交于 2019-11-29 05:47:10
I'm converting an existing app to the Fragments API using the compatibility library. I've read that you're supposed to update classes that extend Activity to now use FragmentActivity. This is fine for most cases, but what about classes that extend ListActivity or MapActivity? What is the preferred way to handle this? I was hoping there was a ListFragmentActivity or something along those lines, but I don't see one. There is a ListFragment: http://developer.android.com/reference/android/app/ListFragment.html For MapActivity, unfortunately you will need to continue to use that; there is no

How can I get android Honeycomb system's screen width and height?

蓝咒 提交于 2019-11-29 05:16:32
my code: Display display = activity.getWindowManager().getDefaultDisplay(); DisplayMetrics displayMetrics = new DisplayMetrics(); display.getMetrics(displayMetrics); System.out.println("screen width:"+displayMetrics.widthPixels); System.out.println("screen heigth:"+displayMetrics.heightPixels); when I run this program in android Honeycomb system,the output is 800 and 1232 but the device's screen is 800_1280,hao can I get it? thanks. This piece of code works for me (if you don't mind to use undocumented methods): Display d = getWindowManager().getDefaultDisplay(); int width, height; Method

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

android searchview setOnActionExpandListener on Honeycomb 3.2

不羁的心 提交于 2019-11-29 01:39:11
I'm developing an app for Android 3.2 and greater with android-support-v4 . I need to implement OnActionExpandListener for "intercept" when SearchView in the actionbar is expanded and when is collapsed. My code for Android 4.0 and higher it's ok, but for 3.2 no. menu.xml <item android:id="@+id/menu_search" android:title="@string/menu_search" android:icon="@android:drawable/ic_menu_search" android:showAsAction="collapseActionView|always" android:actionViewClass="android.widget.SearchView" /> MyActivity.java @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R

Enable hardware acceleration in Android app, targeting Honeycomb AND prior versions

天涯浪子 提交于 2019-11-28 23:28:01
To enable hardware acceleration in an Android 3.0+ app I can do this: <application android:hardwareAccelerated="true" ... /> But the app won't build with that attribute present if I target an OS version pre-11. Is there a way to enable hardware acceleration in an app that targets both Honeycomb and prior, or is hardware acceleration only available for those creating apps that only work on 3.0+? I had a look for a method on Activity but I don't see one. Try to set build target to the 3.0 version, but set minsdkversion to the oldest version you want to support. It should at least allow you to

Orientation change in Honeycomb

南楼画角 提交于 2019-11-28 23:16:23
I have an activity that shouldn't be recreated after an orientation change. I added the following to the activity declaration in the manifest: android:configChanges="orientation" On Android 2.3 this works perfectly. On HONEYCOMB_MR2 onCreate is called anyway when change the orientation. Is there something else that needs to be done on HONEYCOMB_MR2 to prevent recreating the activity after an orientation change? Apparently using orientation|screenSize (?) prevents onCreate on Honeycomb and (so far) does not seem to break anything in previous Android versions. android:configChanges="orientation

onCreateOptionsMenu not being called on FragmentActivity when run on phone version

情到浓时终转凉″ 提交于 2019-11-28 23:09:12
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. You should consider from your Fragment code: 1) Implementing onCreateOptionsMenu(Menu menu, MenuInflater inflater) 2) Calling setHasOptionsMenu

Fragment without a view crashes on configuration change

送分小仙女□ 提交于 2019-11-28 23:07:26
I have an UI where I need a Fragment to be displayed (with a view) in landscape mode but not in portrait mode. In portrait mode it should still be available but will display its result using ListPopupWindow instead. I figured I could handle this by using the <fragment /> tag for the landscape layout while creating the fragment programmatically if it wasn't started (in the case when we are in portrait). This works fine as long as you start out in landscape, if you start in portrait where the fragment is created programmatically your application will crash when you rotate the emulator when it

Is possible install Eclipse IDE in a Galaxy Tab?

二次信任 提交于 2019-11-28 22:40:58
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. 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 for native Android UI controls does not exist. On Linux, SWT implementations exist only for GTK and Motif.