android-3.0-honeycomb

toddler safe app on android

情到浓时终转凉″ 提交于 2019-11-28 22:03:46
I have an app, that should be toddler safe. Meaning that, it blocks any single key touch, yet handles long pressing for exiting the app. This is so that, the toddler will be safe from doing (too) nasty things while playing. Up to version 2.3.4, I succeeded in achieving this. However, now I have 2 problems: On honeycomb, I have the status bar notifications which can be pressed on. Also , I have the switch-windows key which can be pressed. The only thing I succeeded with it is to dim the status bar. On ice cream sandwich (using emulator, I still don't have a real device with this version), when

WebViewFragment webView is null after doing a FragmentTransaction

血红的双手。 提交于 2019-11-28 21:32:14
问题 I currently have my application set up with a ListFragment on the left and a DetailsFragment on the right (similar to the layout on the tablet below). On the details fragment (fragment next to the list) I have a goto deal button, which when pressed should replace the detailsFragment with a WebViewFragment . The problem I am having is that when trying to load a url in the webviewfragment the WebView is null. WebViewFragment webViewFragment = new WebViewFragment(); FragmentTransaction

Custom preference, targetSdkVersion=“11”: missing indent?

夙愿已清 提交于 2019-11-28 21:21:53
I have a couple of custom DialogPreference implementations floating around, such as this one : package apt.tutorial; import android.content.Context; import android.content.res.TypedArray; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.preference.DialogPreference; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; import android.widget.TimePicker; public class TimePreference extends DialogPreference { private int lastHour=0; private int lastMinute=0; private TimePicker

Android 3.0 ActionBar, changing colors

╄→гoц情女王★ 提交于 2019-11-28 20:48:24
How can I change the color of the underline beneath the tabs? It's currently the light blue, and I can't find any resources on how to change this for Android 3.0. Additionally, I'd like to change the text color for the menu items that show up on the right of the ActionBar as a result of: android:showAsAction="ifRoom|withText" Anyone know how to change these? You can control the appearance of the tabs by using the properties android:actionBarTabStyle , android:actionBarTabBarStyle , and android:actionBarTabTextStyle . This section in the official developer guide shows a sample xml to customize

How can I create a weekly calendar view for an Android Honeycomb application?

南楼画角 提交于 2019-11-28 20:35:28
问题 I am working on an Android (v3.0) application that has a requirement of mimicking the weekly calendar layout found on Google Calendar: The events will be based on external requests through the Google Calendar API (I already have this part working). Using the API, I can obtain a list of events for the week, with each event having a starting and and ending datetime. I would like to use this data to show the scheduled events to the application's users in a view similar to the one above. Here's

Show fragment as a dialog or as a usual activity

可紊 提交于 2019-11-28 20:23:38
In my app I've got a fragment which is called "About". On handhelds I want this fragment to look like a usual activity but on tablets I want it to be a dialog. Which way is preferred to handle this situation? Make a style for this in your styles.xml (two styles.xml files, one in the values folder, the other in a values-large folder) but have the style you put in the values-large folder inherit from Theme.Dialog. Then have your fragment use that style. The system will take care of the rest. Alternatively, make your class a DialogFragment, and then either embed it into a view hierarchy, or show

WebView “flashing” with white background if hardware acceleration is enabled (Android 3.0+)

别来无恙 提交于 2019-11-28 17:24:08
问题 I have an issue with the WebView (Android 3.0+), which the WebView always displays a white background before display my black background ("flashing"). Here is my simple test code: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); WebView webView = new WebView(this); webView.setBackgroundColor(Color.BLACK); setContentView(webView); loadWebView(webView); webView.loadDataWithBaseURL("localhost://", "<html><head>" + "<style>body {background-color:

Android Action bar custom dropdown view on item click

梦想与她 提交于 2019-11-28 16:45:20
I'm writing an Android app for tablets. I've gone with the action bar to create my icons. However, I need to open a custom view when one of the menu items is clicked. I don't want a custom action bar - I need to inflate a custom view when the "Browse Subjects" action bar item is clicked. This view will need to appear like a dropdown but be using my own custom layout as it will not be used for navigation. Here is my menu.xml <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_browse" android:title="Browse Subjects" android:showAsAction="always" android

Appwidget size calculation

ⅰ亾dé卋堺 提交于 2019-11-28 16:07:28
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 Galaxy Tab with Gingerbread and then it resolves to a 6x1 (like one would expect). So two questions here

Strategies for Honeycomb & backward compatibility

我的未来我决定 提交于 2019-11-28 15:35:49
So we've seen the preview sdk and the neat new stuff like ActionBar and Fragments. Making a lot of method calls will be unavoidable to make use of these, so what strategies are there for maintaining 1 version of the app, which will let me use all the snazzy new stuff but also work on devices running 2.3 or below? My app targets 1.5 - 2.3 at the moment. The same fragment APIs are now available as a static library for use with older versions of Android; it's compatible right back to Android 1.6. There are a few tricks you can use to see if the various new APIs are available to your app.