android-3.0-honeycomb

Positioning menu items to the left of the ActionBar in Honeycomb

亡梦爱人 提交于 2019-11-26 22:52:52
问题 I want to position some menu items to the left of Honycomb's ActionBar, but have found no documentation showing how to do this. It looks like it should be possible since the Contacts app has search to the immediate left of the navigation bar. Any idea as to how to set menu items to the left side? 回答1: The ActionBar has support for a custom layout between the application icon and the regular ActionBar icons. Example: // Set the custom section of the ActionBar with Browse and Search. ActionBar

Updating an ongoing notification quietly

眉间皱痕 提交于 2019-11-26 22:38:12
问题 I have a service which connects to other devices wirelessly. When the service is enabled, I have an ongoing notification which states it is enabled. After the service is enabled, the user then connects to another device. At this point, I would like to update my ongoing notification to state the name of the device which has been connected to. This is easy enough to do by calling startForeground(ONGOING_NOTIFICATION, notification) again with the updated information; however this flashes the

How to add submenu items to ActionBar action in code?

青春壹個敷衍的年華 提交于 2019-11-26 22:19:34
问题 Via xml I can add submenu items to my action in the ActionBar . main_menu.xml: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_new_form" android:icon="@drawable/ic_new_form" android:title="@string/menu_new_form" android:showAsAction="ifRoom|withText"> <menu> <item android:id="@+id/form1" android:icon="@drawable/attachment" android:title="Form 1" android:onClick="onSort" /> <item android:id="@+id/form2"

How can I execute something just once per application start?

丶灬走出姿态 提交于 2019-11-26 22:06:28
I'd like to implement an update checker in an application, and I obviously only need this to show up once when you start the application. If I do the call in the onCreate() or onStart() method, it'll be shown every time the activity is created and this is not a viable solution. So my question is: Is there a way to do something, like check for updates, just once per application start / launch? I'm sorry if it's a bit hard to understand, I'm having difficulties explaning myself on this one. SharedPreferences seems like ugly solution to me. It's much more neat when you use application constructor

HW accelerated activity - how to get OpenGL texture size limit?

我只是一个虾纸丫 提交于 2019-11-26 19:46:27
I'm trying to enable hw acceleration in Honeycomb, and display some Bitmaps on Canvas. All works fine, but for large bitmaps (>2048 in one dimension), I get error in log: OpenGLRenderer: Bitmap too large to be uploaded into a texture I know this is because of hw limitation, and can work-around it by reducing max bitmap size to be displayed if hw acceleration is enabled (checking by View.isHardwareAccelerated()). My question is: how to easily determine max texture size available for Bitmap drawing by hardware. 2048 seems to be limit on my device, but it may be different on different ones. Edit:

Remove application icon and title from Honeycomb action bar

ぃ、小莉子 提交于 2019-11-26 19:37:49
How can I remove the application icon & title which comes by default in an action bar? There is a similar question here: Can i hide the App Icon from the Action Bar in Honeycomb? , but it doesn't talk about how to do it? CommonsWare Call setDisplayShowHomeEnabled() and setDisplayShowTitleEnabled() on ActionBar , which you get via a call to getActionBar() . If you want to do it the XML way, then define a style (XML file) in the /res/values-v11/ folder with the following contents: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="MyTheme" parent="android:style/Theme.Holo"> <item

What are the benefits of CursorLoaders?

不想你离开。 提交于 2019-11-26 19:15:14
问题 I use Cursors extensively in my app, to load and occasionally write information from and to a database. I have seen that Honeycomb and the Compatibility Package have new Loader classes designed to help with loading data in a "good" way. Essentially, are these new classes (in particular CursorLoader ) considerably better than previous methods of managing data? What is the benefit of a CursorLoader over managed Cursors for example? And I use a ContentProvider to deal with data, which obviously

Intent.putExtras size limit?

霸气de小男生 提交于 2019-11-26 18:36:17
问题 I'm trying to pass data from one activity to another via Intent.putExtras like this: private ArrayList<HashMap<String, String>> mGroups = new ArrayList<HashMap<String, String>>(); private ArrayList<HashMap<String, String>> mUsers = new ArrayList<HashMap<String, String>>(); ... Bundle data = new Bundle(); data.putInt("mode", mode); data.putSerializable("groups", (Serializable) mGroups); data.putSerializable("users", (Serializable) mUsers); data.putInt("current_class", mCurrentClassId); data

Displaying icon for menu items of Action Bar in Honeycomb android 3.0

巧了我就是萌 提交于 2019-11-26 17:48:24
问题 hi I am developing an android application using Honeycomb android 3.0 . I am tryig to display a menu in Action Bar . The menu has an icon and tiltle. When we click the menu item it displays its items in the form of a dropdown list .It was the items in drop down list with item names but with out icon it is displaying . I want an icon to be displayed beside the title in drop down list which appears when I click the menu. can anyone help me in sorting out this issue. my xml file is as below: <

How to add app's shortcut to the home screen

会有一股神秘感。 提交于 2019-11-26 16:58:52
问题 I know it's not documented and won't work on every device, but I see more and more apps placing their shortcuts on the home screen after they got installed. Found bunch of code chunks how to do it but for me they don't fit together. This is what I got for now. Need a permission in the manifest. <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> Create an Intent of activity that should be called. Ex (from cgeek): Intent shortcutIntent = new Intent();