android-4.0-ice-cream-sandwich

Android spinner with date picker, like Google Calendar app

有些话、适合烂在心里 提交于 2019-11-27 17:37:01
I'm trying to get a text box that looks like a spinner to activate a date picker dialog. This is done in both the Google Calendar app and the Contacts app (for birthdate) on ICS. Do I need to use a spinner, and if so how do I change it's input view to be a date picker? Or if not, how do I get a text view to have the little triangle that usually indicates a spinner? codinguser Twaddington's comment on his answer is actually the right approach. What you need is to create a text view and apply the style style="@android:style/Widget.DeviceDefault.Light.Spinner" Then you can create a click listener

android EditText blends into background

只谈情不闲聊 提交于 2019-11-27 16:33:51
问题 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

how to set json parsed data in a listview and then adding search functionality in it

痴心易碎 提交于 2019-11-27 16:18:57
I am new to android and want to parse json data in a listview and then add search functionally to it, but I don't know how to add search. The Java class is: public class AndroidJSONParsingActivity extends ListActivity { // url to make request private static String url = "http://10.0.2.2/quick/punk.php"; // JSON Node names private static final String TAG_CUSTOMER = "Customer"; private static final String TAG_CUSTOMER_CODE = "customer_code"; private static final String TAG_CUSTOMER_NAME = "customer_name"; private static final String TAG_CUSTOMER_MOBILE = "customer_mobile"; private static final

Something's wrong in Corner radius Android

☆樱花仙子☆ 提交于 2019-11-27 15:30:18
I'm making my own search view for Android 2.3. I have. LinearLayout (Horizontal) AutoCompleteTextView ImageButton I added the button and AutoCompleteTextView to LinearLayout . I want to put a corner radius in my own control like the image shown below. I set this drawable to ImageButton <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="true" > <shape> <solid android:color="#27AFE0" /> <stroke android:width="0.5dp" android:color="#000000" /> <corners android:topRightRadius="10dp" android:bottomRightRadius="10dp" android:topLeftRadius="0.1dp"

Android 4.0 ICS turning HttpURLConnection GET requests into POST requests

南楼画角 提交于 2019-11-27 14:25:51
My Galaxy Nexus arrived today, and one of the first things I did was to load my app onto it so I could demonstrate it to my friends. Part of its functionality involves importing RSS Feeds from Google Reader. However, upon trying this, I was getting 405 Method Not Allowed errors. This problem is Ice Cream Sandwich-specific. The code I've attached works fine on Gingerbread and Honeycomb. I've traced the error down to the moment the connection is made, when the GET request magically turns into a POST request. /** * Get the authentication token from Google * @param auth The Auth Key generated in

How to control ActionBar split programmatically?

北战南征 提交于 2019-11-27 11:46:52
问题 The android ActionBar may split into a top and bottom bars if activity's parameter " uiOptions " is set to " splitActionBarWhenNarrow ", note this parameter is only valid in ICS. Honeycomb has introduced a new approach to multi-select list items using action bar. When a item is under press & hold the list becomes into a multi-selection mode and the actionbar bar may be used to accomplish some actions. The actionbar setup is inherited from the list activity, i.e., if the activity has a split

Is there a way to hide the system/navigation bar in Android ICS

烈酒焚心 提交于 2019-11-27 11:15:36
I'd like to extend the discussion regarding hiding of the system/navigation bar at the bottom of the screen on Android Ice Cream Sandwich (4.0 and up) tablet devices. There's already a thread ( Is there a way to hide the system bar in Android 3.0? It's an internal device and I'm managing navigation ) about hiding the bar on Honeycomb devices. My clients, however, will be using the newest Ice Cream Sandwich devices and are very keen on hiding the bar at the bottom the screen. Their application is not for regular consumer use and it's very important for them to take over the whole screen to

How to programmatically create a new VPN interface with Android 4.0?

我只是一个虾纸丫 提交于 2019-11-27 11:03:11
I'd like to know whether it's possible to create a VPN interface programmatically with the new VPN APIs in Android 4.0. I've looked through http://developer.android.com/resources/samples/ToyVpn but this is about creating a complete VPN client that handles the connections etc. I only want to add a new VPN configuration and possibly remove existing ones. There are lots of questions like this but they all seem to be pre 4.0. I understand that previously this wasn't possible, but one would think that the new VPN APIs provided such functionality. So has anyone found a way to do this, or is it still

Appwidget size calculation

感情迁移 提交于 2019-11-27 09:33:18
问题 It might be me, but when I calculate minimum app widget sizes according to the formula given on the android page I don't get the right widget widths; The formula is as follows: width(n) = (70 x n) - 30 When I want to have a 5x1 widget, the correct width would be (5 * 70) - 30 = 320dp. However when testing this on a motorola Xoom it resolves to being a 4x1 widget. I've tested different values and 400dp seems good for 5x1 on the motorola xoom with Honeycomb, but then I'd test it on a regular

MediaButtonIntentReceiver not working in Android 4.0+

折月煮酒 提交于 2019-11-27 09:15:51
The goal is to intercept broadcasts from the headset, as well as bluetooth eventually, to respond to different types of clicks from the headset to alter the mediaplayer. This solution works fine for all versions prior to ICS. Here is some of the code and things I have tried: .... private BroadcastReceiver mediaButtonReceiver = new MediaButtonIntentReceiver(); .... public void onCreate() { ... IntentFilter mediaFilter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON); mediaFilter.setPriority(2147483647); // this is bad...I know this.registerReceiver(mediaButtonReceiver, mediaFilter); ... } public