android-3.0-honeycomb

ViewPager: Recursive entry to executePendingTransactions

╄→尐↘猪︶ㄣ 提交于 2019-11-26 16:11:18
问题 I have a ViewPager within a ViewPager and I am getting this exception 09-07 18:30:26.392: ERROR/AndroidRuntime(841): FATAL EXCEPTION: main java.lang.IllegalStateException: Recursive entry to executePendingTransactions at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1331) at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:422) at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:86

Retain Fragment state between Activities

半城伤御伤魂 提交于 2019-11-26 16:09:14
问题 Its possible to retain a Fragment between Activities? Lets say I have Activity A with Fragment F_Left placed at the left and Fragment F_Right placed at the right. If I want to launch a new Activity and keep Fragment F_Left ... how can I do it? Can I retain Fragment F_Left state between activities? Note that I want to launch a new Activity because Fragment F_Left is my app menu and Fragment F_Right changes completely the context of the user operations... and my app have many of operations, so

Styling EditText view with shape drawable to look similar to new holographic theme for Android < 3.0

假装没事ソ 提交于 2019-11-26 15:28:24
问题 I want to create a shape drawable for that mimics the new holographic theme (Android >=3.0) on older Android versions. It's quite easy to draw a line at the bottom with <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape > <solid android:color="@color/border" /> </shape> </item> <!-- main color --> <item android:bottom="1.5dp"> <shape > <solid android:color="@color/background" /> </shape> </item> </layer-list> But how

Fragments onResume from back stack

[亡魂溺海] 提交于 2019-11-26 15:03:00
I'm using the compatibility package to use Fragments with Android 2.2. When using fragments, and adding transitions between them to the backstack, I'd like to achieve the same behavior of onResume of an activity, i.e., whenever a fragment is brought to "foreground" (visible to the user) after poping out of the backstack, I'd like some kind of callback to be activated within the fragment (to perform certain changes on a shared UI resource, for instance). I saw that there is no built in callback within the fragment framework. is there s a good practice in order to achieve this? oriharel For a

Android GridView with categories?

社会主义新天地 提交于 2019-11-26 14:05:51
问题 Is it possible to use categories or some sort of headers with a GridView in Android? I put together a quick illustration of what I was thinking about: Thanks a lot. 回答1: You can use Stickygridheaders library directly or as a model to create your own widget. 回答2: probably this code will help you. This is SectionedGridRecyclerViewAdapter, result looks like this: 回答3: I think You can do it but you have to implement Jeff Shrkey's SeparatedListAdapter There isn’t an easy way of creating these

Was PreferenceFragment intentionally excluded from the compatibility package?

℡╲_俬逩灬. 提交于 2019-11-26 13:58:58
I'm looking to write preferences that can be applied to both 3.0 and pre-3.0 devices. Discovering that PreferenceActivity contains deprecated methods (although these are used in the accompanying sample code), I looked at PreferenceFragement and the compatibility package to solve my woes. It appears, though, that PreferenceFragment isn't in the compatibility package. Can anyone tell me whether this was intentional? If so, can I easily target a range of devices (i.e. < 3.0 and >=3.0) or will I have to jump through hoops? If it wasn't intentionally excluded, can we expect a new release of the

ActionBar background image

僤鯓⒐⒋嵵緔 提交于 2019-11-26 12:37:32
问题 I\'ve inherited the Holo Light Theme and customized the background of the ActionBar with the following: Content of styles.xml <?xml version=\"1.0\" encoding=\"utf-8\"?> <resources> <style name=\"ActionBar\" parent=\"@android:style/Widget.Holo.ActionBar\"> <item name=\"android:background\">@drawable/actionbar_background</item> </style> <style name=\"MyTheme\" parent=\"@android:style/Theme.Holo.Light\"> <item name=\"android:actionBarStyle\">@style/ActionBar</item> </style> </resources> Content

Technical details of Android Garbage Collector

雨燕双飞 提交于 2019-11-26 12:24:13
问题 As I\'m doing a research on commonalities/differences of various mobile platforms, one of the aspects under investigation is memory management. As such, I\'m interested in more detailed technical information on the various mechanisms. In specific, e.g. which garbage collector type does Android use ? ([Google Groups Discussion] suggests that it is using \"tracing\" mechanism - but I\'d appreciate a \"more official\" source which I could possibly quote, plus hoping to find information there

How to set a Fragment tag by code?

匆匆过客 提交于 2019-11-26 12:12:28
问题 I haven\'t found something like setTag(String tagName) method in the Fragment class. The only way to set a Fragment tag that I have found is by doing a FragmentTransaction and passing a tag name as parameter. Is this the only way to explicitly set a Fragment tag by code? 回答1: Yes. So the only way is at transaction time, e.g. using add , replace , or as part of the layout. I determined this through an examination of the compatibility sources as I briefly looked for similar at some point in the

Is there a method that works like start fragment for result?

淺唱寂寞╮ 提交于 2019-11-26 12:08:00
问题 I currently have a fragment in an overlay. This is for signing in to the service. In the phone app, each of the steps I want to show in the overlay are their own screens and activities. There are 3 parts of the sign-in process and each had their own activity that was called with startActivityForResult(). Now I want to do the same thing using fragments and an overlay. The overlay will show a fragment corresponding to each activity. The problem is that these fragments are hosted in an activity