android-3.0-honeycomb

Change ListView choiceMode from singleChoice to multipleChoiceModal

泄露秘密 提交于 2019-11-29 18:27:31
问题 I have a ListView that normally is the singleChoice choiceMode . When the user long presses on an item, I want to enter an action mode that allows selecting multiple items so they can perform an action on any selected items. I am able to configure the ListView so that it is in singleChoice mode and the user is able to select list items to display a details fragment next to it and have the list item itself shown in its activated state. I am also able to configure the ListView so that it is in

listview gets out of memory exception, but with no memory leaks?

前提是你 提交于 2019-11-29 14:55:26
After Honeycomb, Google said that bitmaps are managed by the heap (talked about here ), so if a bitmap is no longer accessible, we can assume that GC takes care of it and frees it. I wanted to create a demo that shows the efficiency of the ideas shown for the listView lecture (from here ), so I made a small app. The app lets the user press a button, and then the listview scrolls all the way to the bottom, while it has 10000 items, which their content is the android.R.drawable items (name and image). For some reason, I get out of memory even though I don't save any of the images, so my question

Honeycomb and TabHost specs

佐手、 提交于 2019-11-29 14:32:24
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 inflate the layout file R.layout.tab_indicator which doesn't appear to be available. TabHost.TabSpec

honeycomb sync adapter features for editing contacts

偶尔善良 提交于 2019-11-29 12:48:25
I'm developing a sync adapter. I found this: http://groups.google.com/group/android-developers/msg/85f9304dfcc4e284 In that forum a google employee states: In releases of Android from Eclair through Gingerbread integrated editing of 3rd party contacts is poorly supported. The trick is to insert a data row, "Edit in MyApp", which would take the user to your app and your app would then provide an editor activity. Also, there is no provision in the Contacts UI for creating new contacts in 3rd party accounts. We have fixed those issues in Honeycomb. Now you can specify two activities in your

Handling orientation changes with Fragments

江枫思渺然 提交于 2019-11-29 11:10:34
I'm currently testing my app with a multipane Fragment -ised view using the HC compatibility package, and having a lot of difficultly handling orientation changes. My Host activity has 2 panes in landscape ( menuFrame and contentFrame ), and only menuFrame in portrait, to which appropriate fragments are loaded. If I have something in both panes, but then change the orientation to portrait I get a NPE as it tries to load views in the fragment which would be in the (non-existent) contentFrame . Using the setRetainState() method in the content fragment didn't work. How can I sort this out to

Using Multiple Fragments in an single activity

岁酱吖の 提交于 2019-11-29 10:47:11
问题 I want to develop an android application using Honey Comb 3.0 in which I want to display a list , clicking on any item in a list should display another list beside that list item in the form of Fragment. Can any one provide me sample code in sorting out this issue? Thanks in Advance, 回答1: Have a look at these two blog posts from Google's Reto Meier: http://blog.radioactiveyak.com/2011/02/android-app-surgery-earthquake-redux.html http://blog.radioactiveyak.com/2011/02/strategies-for-honeycomb

DialogFragments with devices api level < 11

拟墨画扇 提交于 2019-11-29 08:49:44
问题 I am in the process of making a honeycomb project/fork backwards compatible with 1.6+. Based on the documentation provided by Google/Android I decided to build off all my fragments off DialogFragment s which worked great for honeycomb...it gives me the flexibility to put anything as a dialog or 'full screen' element. I've now incorporated the compatibility kit and moved my imports and method calls over to that. Now that I'm on 2.3 I am trying to launch an identical intent but I receive this

Android ActionBar tab style for Honeycomb

北城余情 提交于 2019-11-29 07:21:19
I am using the HoneycombGallery sample app in the SDK and attempting to change the style of the ActionBar tabs (i.e., "Balloons", "Bikes", "Androids", "Pastries"). Using the "light" theme, the tabs have a blue underline. I simply want to make this red to match the style of an application I'm working on. I've tried researching styles in the SDK documentation ( http://developer.android.com/guide/topics/ui/actionbar.html ) and other sources on the web, but I'm not quite certain that I understand what property/attribute controls this particular style of the tabs. If anyone has a resource or code

IllegalArgumentException: No view found for id for fragment when fast switching ActionBar Tabs

烂漫一生 提交于 2019-11-29 06:38:40
I am developing an Android app for tablets and not using the compatibility library. There is just one Activity and it uses the ActionBar with 3 tabs. In the TabListener I use setContentView to load the layout specific to that tab, and then add the relevant fragments to their frames. This almost works exactly like I want, except when you switch between the tabs fast enough the app will crash. I am using a Samsung Galaxy Tab as my debugging device and switching tabs is really fast. At a normal pace I can tap back and forth between them and the pages are loaded instantly. The problem is when I

how to change Android overflow menu icon

安稳与你 提交于 2019-11-29 06:19:50
问题 How do i change the Overflow Menu icon on the far right of the action bar as seen in the image below? My Holo theme specifies this 3 row black stack icon by default and i want something else. i can't seem to find a solution for this. I have looked at the documentation on http://developer.android.com/guide/topics/ui/menus.html but it doesn't seem to lend much help. Thanks! 回答1: Define a custom style: for example, let's call it customoverflow . In this style you set android:src to the picture