android-3.0-honeycomb

How do I dim the system bar in Android 3.0 (Honeycomb)?

限于喜欢 提交于 2019-12-17 12:11:50
问题 How do I programatically dim the system bar in Android 3.0 (Honeycomb)? 回答1: Try using the following code: View v = findViewById(R.id.myview); v.setSystemUiVisibility(View.STATUS_BAR_HIDDEN); 回答2: you can dim it using SYSTEM_UI_FLAG_LOW_PROFILE but it will appear when user touch the bar. But you can disable it except home. add this in manifest. <uses-permission android:name="android.permission.EXPAND_STATUS_BAR"/> inside onCreate() this.requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow

Retain the Fragment object while rotating

余生长醉 提交于 2019-12-17 08:31:07
问题 I have developed an app in Honeycomb and I am using fragments. This is my app I have an Activity (Say A1) and in that there is a fragment Initially this fragment hold the object one fragment object say (F1) Then depending on the user actions it may change to other objects F2,F3 .... What my problem is When The user rotate the device the activity is recreated and which make F1 as the fragment object even though before rotating it wasn't What is the way to retain the fragment object while

How to detect “Recent Apps” system button clicks (Honeycomb+)

你离开我真会死。 提交于 2019-12-17 07:25:29
问题 I'm wondering what method this button calls. My game always pauses/resumes correctly except for when I use this button, its seems like this button doesn't call the onPause() and onResume() methods of an Activity. It works if I exit the game, go to another window(like the one on the picture) and then use this button to resume. But If I just press this button, when ingame, the game pauses but the thread dosnt resume like it does every other time, the game kind of just stands still on screen and

How can I customize the Action Mode's color and text?

*爱你&永不变心* 提交于 2019-12-17 07:19:49
问题 The default action mode (3.0 and up) comes with a green theme and a 'Done' button on the left side. How can I customize these? Thanks 回答1: This is the style used for any ActionMode, I pulled it from the SDK. You'll need to create your own style to customize it. It's really easy to do. If you've never done anything like this before, you should read through this post on customizing the ActionBar. It explains everything you'll need to know. <style name="Widget.ActionMode"> <item name="android

How can I customize the Action Mode's color and text?

回眸只為那壹抹淺笑 提交于 2019-12-17 07:19:21
问题 The default action mode (3.0 and up) comes with a green theme and a 'Done' button on the left side. How can I customize these? Thanks 回答1: This is the style used for any ActionMode, I pulled it from the SDK. You'll need to create your own style to customize it. It's really easy to do. If you've never done anything like this before, you should read through this post on customizing the ActionBar. It explains everything you'll need to know. <style name="Widget.ActionMode"> <item name="android

How can I execute something just once per application start?

不羁岁月 提交于 2019-12-17 05:50:18
问题 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. 回答1

Remove application icon and title from Honeycomb action bar

隐身守侯 提交于 2019-12-17 04:45:30
问题 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? 回答1: Call setDisplayShowHomeEnabled() and setDisplayShowTitleEnabled() on ActionBar , which you get via a call to getActionBar() . 回答2: 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

Is it possible to display icons in a PopupMenu?

情到浓时终转凉″ 提交于 2019-12-17 03:35:45
问题 I really like the new PopupMenu we got in 3.0, but I just can't display any icons next to the menu items in it. I'm inflating the menu from the .xml below: <item android:id="@+id/menu_delete_product" android:icon="@drawable/sym_action_add" android:title="delete" android:showAsAction="ifRoom|withText" /> <item android:id="@+id/menu_modify_product" android:icon="@drawable/sym_action_add" android:title="modify" android:showAsAction="ifRoom|withText" /> <item android:id="@+id/menu_product_details

Changing overflow icon in the action bar

纵饮孤独 提交于 2019-12-17 03:22:25
问题 Is it possible to change the overflow icon in the action bar? I have blue icons for all ActionBar items and I also want to change the overflow icon when it appears. 回答1: You can with a style, but you have to add it to the main Theme declaration. <resources> <!-- Base application theme. --> <style name="Your.Theme" parent="@android:style/Theme.Holo"> <!-- Pointer to Overflow style ***MUST*** go here or it will not work --> <item name="android:actionOverflowButtonStyle">@style/OverFlow</item> <

OnCreate runs AFTER onActivityResult on Honeycomb?

不羁的心 提交于 2019-12-14 01:06:01
问题 I am using startActivityForResult() to allow the user to choose a file form the file system in my app. After the file is chosen, OnActivityResult() runs and I save the file path to a variable and proceed. This works fine on Android 2.3 and lower. On Honeycomb, however, OnCreate() runs again AFTER OnActivityReult() , essentially restarting my activity so I am unable to hold any variables because it runs an entirely new activity after I get the result. Any idea why this is, and what I can do