I'm using https://gist.github.com/8cbe094bb7a783e37ad1 in order to display multiple page of a ViewPager at once. It works great with a simple PageAdapter, but I need to display a large amount of Bitmaps. So I read http://developer.android.com/training/displaying-bitmaps/index.html and it says :
You can implement this pattern using a ViewPager component backed by a PagerAdapter. However, a more suitable backing adapter is the subclass FragmentStatePagerAdapter which automatically destroys and saves state of the Fragments in the ViewPager as they disappear off-screen, keeping memory usage down.
I tried to create a new FragmentStatePagerAdapter but it doesn't work :
E/AndroidRuntime(25400): android.content.res.Resources$NotFoundException: Unable to find resource ID #0xffffffff
I really don't understand what's the error, because I'm not using any particular resources except layouts.
Does anyone have an idea how to resolve this ?
I just discover that it works when I add an android:id to the ViewPager inside the PageContainer. So, just with an id it seems to work, but I don't understand why.
If someone have an idea, I'll be glad to understand.
The documentation explicitly says so:
When using FragmentPagerAdapter the host ViewPager must have a valid ID set.
I'm glad I found your answer because it was giving me a headache for quite some time as well. Soon as I saw your answer I remember skimming it and feeling like an idiot.
Related
I have a view named _RequirementAreaExtranetContent. When trying to load it, I get the VirtualFile content from my VirtualPathProvider. I have boiled it down to the simplest HTML inside, and also replaced the content with that of a partial view that IS working. Does anyone have any idea why it may not be loading?
It turns out you CANNOT have a view named content. I cannot find this documented anywhere, but when I renamed it to _RequirementAreaExtranetContelt it worked fine. I would love to know if anyone knows what happens with this, but hopefully it at least will save someone the headache I have from slamming their head against it for an hour :)
I have a vague memory of a Unity video tutorial where the guy hid some objets while building a scene. The thing is that he dind't use the usual 'disable/enable the object via the inspector checkbox' and so he didn't have to worry to enable them later... moreover, as the objects were 'invisible but enabled', all attached behaviours were working.
As far as I remember the effect was pretty similar to moving the object into a hidden layer (but not changing the object layer but using a different Unity built-in action so he actually dind't change anything in the object).
I've been trying to remember how he did such a thing and looking around the editor to find the specific option but with no luck. Honestly, I'm beginnig to think that I might not be remembering correctly. Do anyone know about this 'hide objects without changing them' command?
Regards!
Sounds like he might have just turned the object's renderer off. Each GaneObject is going to have some kind of renderer as a property in the inspector (sprite renderer if its 2D, ect). He probably just disabled that as opposed to disabling the entire GameObject. Let me know if that helps!
I've just received by chance a link to a video on twitter (I think it's the very same I was trying to remember but I'm not 100% sure). Anyway it seems that my current Unity version 2018.3.3) doesn't include that 'Scene visibility' toggle; it seems to be available for 2019 Beta. . I didn't test it yet but it seems pretty straightforward, just click on a gray bar in the hierarchy bar, to the left of the object you want to 'hide'; the bar seems to work as a an visible/not visible toggle. Here a link to de video where you can see the thing working!
I hope it helps!!
I'm trying to develop my first app, starting to create a new one...
I can't find in documentations where to change the getting start dialog https://snag.gy/JWliB7.jpg
I'm looking everywhere, configs, settings but no luck.
Any help please?
The getting started as of now is tied in with the app catalog. The reason behind it is fairly complex, but we basically wanted to make sure that the getting-started comes from outside the app itself, so that security warnings etc. could be shown at a later time.
If you need a kind of a "user getting started" and not an admin/developer getting started, for now I recommend that you create a view like "0 getting started" so it's the first to be shown, and in those instructions you can also explain how to set this view to hidden once the user understands all.
Is there a way via extendscript (jsx) to get the visibility status of Photoshop' guides?
The code to show and hide the guides is the same code as it 'toggles' the guides on or off so it must know the status when this code is executed, but how do I get at it?
I appreciate this could be done via a preference switch but that seems an awkward hack for something this simple, especially as something somewhere must be accessing this 'property' during execution of the 'toggle' code.
What would be great is to have activeDocument.guides.visible property, returning either true or false. Is there anything like that?
EDIT:
OK. Further investigation reveals that creating a guide using guides.add does not automatically toggle guides ON, however, using the code generated via the scriptListener does.
I would rather use guides.add as its only one line of code compared to fourteen so in order to toggle the guides to ON I thought I could run a function that created and then deleted a guide using the scriptListener code during the onLoad of the HTML.
This works great, except getting this function to run only when a document is opened is now the new problem.
documentAfterActivate is supposed to be the code to do this except it doesn't work unless a flash panel such as kuler is opened first.
So the question now is really what part of the flash code is allowing documentAfterActivate to work properly and how can I use it in my code instead of opening a flash panel I don't need?
It doesn't look like you've got a direct toggle option. You'd need to record the position of the guides somewhere and use script listener code to clear them when you wanted to toggle them off and use the add method on the Guides object to re-add them.
Keep in mind that even getting to the guide position via the photoshop DOM wasn't avail before CS4 I think? maybe CS5.
And i realised I just mis-read your question quite a bit. Anyway, this way you'd also know if the guides were visible based on whether or not they are there :) But yes, it isn't as nice as it could be.
The solution:
As stated, the workaround is to create and delete a guide with the fourteen lines of code from the scriptListener.
This toggles the guide visibility to ON regardless of its current state.
I can then save this status as a preference using putCustomOptions.
A function to do this is fired during the onLoad of the HTML but only when a document is opened otherwise guide creation fails.
documentAfterActivate does not work as expected unless a further flash panel (such as Kuler) is also opened beforehand.
An alternative to documentAfterActivate is to register the open event using CSevent instead.
The code can be found HERE.
Im having fun toying with AIR and want to use it to create an application for my TV, but Im coping with a serious & dumb problem : TV ergonomics. Indeed, without a mouse, it is all about focus on elements and moving this focus in a natural fashion.
In HTML this is handled by the browsers perfectly, but in ActionScript Im having a real hard time ! For instance, I don't even know how to have an element on autofocus, so that when I load the app there is already something to click on (without it I just can't interact with my app at all!).
Do you have any idea on the best ways to create a listener for the remote controller arrows and OK button (should be enough) so that I never get stuck in the app ?
So whether you have already struggled with that or if you simply happen to know how to play with the focus and setFocus() parts of Flex, your help is very welcome !
I recommend you look at the Google TV Flash template. It's all about controls and navigation. I'm not sure if this works for Flex as I have not done any gtv development yet.