Android activity navigation bug - android

I'm having a weird bug that I'm not sure how to debug. I have have an activity set up to show movie trailers and reviews. Everything looks and works fine when the app is initially started unless I navigate away from the app to another app or youtube to watch the trailer. Then when I come back into my app the trailer names and reviews are all out of the original order and just messed up (some are duplicated). However when I click on the the trailer name (that is now incorrect) it takes me to the correct trailer! Also when I come back to the app if I try rotating the phone sideways it won't rotate. Rotation and everything else works perfectly fine before I navigate away from the app and come back. I'm so confused. I've tried different onSaveInstanceState etc. implementations but nothing is working. I don't even know what code snippet to post since I don't know where the error could possibly be occurring.

Yup as David Wasser wrote above the issue was with my adapter and nothing to do with onSaveInstanceState. I was assigning the textview in the incorrect method of the adapter (I was assigning it where I defined my viewholder and not on the onBind method) so it wasn't being handled properly.

Related

Android TV Leanback Settings Fragment present multiple items as focused

I noticed something strange after implementing and testing a settings screen for my TV app using the LeanbackSettingsFragmentCompat class, please see attached image:
As you can see, after navigating with the remote to other items, the items no longer in focus still retain their focused background state, I was only able to reproduce this behaviour on one device, and it rarely happens
This problem has left me a bit perplexed,as this is not my implementation but rather Leanback's.. But still, I have never seen a TV app with this problem
Has anyone ever encountered such an issue? Could I have made a mistake to cause something like that?
I would be happy to share code, but at this point I don't know if my code is even relevant to this problem
Thanks in advance

How come if you click an ad in my game it causes the game to restart?

I just started to experiment with ads for the first time so I am a complete beginner at this stuff. I have the ads running at the right screens which is good but if you click an ad and it takes you out of the game it causes the game to restart. I made my game in libgdx and I use the pause function and what not but it obviously doesn't call that and in fact just causes a full restart which would make a lot of users angry. Anyone else having this issue or I am doing something wrong?
I am using admob by the way.
EDIT
I also just realized that it happens on my nexus 5 and not my nexus 7.
I think it happened to me some while ago with a game that tried to implement fb sign in functionality. The second it got back from the sign it, it restarted.
What might be happening in your case is that when you click on the add, android switches from your LibGDX activity to the admob activity. Once you come back, the onCreate method gets called again, therefore restarting your app from scratch. (A simple way to verify this is just to add a Log call everytime the app on create method is entered, and check the behaviour of your app)
If that is the case, a possible workaround for it is checking that if your game has been already initialized it should not instantiate it again.
The restart means that your app has crashed. That's standard Android behaviour.
I suspect you have wired something up incorrectly. Look at you log. There's a good chance something hasn't been initialised that should have.

Application behaves weirdly when made to run on device

I have created an application that has a lot of pages and the user navigates from one to another according to his needs. The application runs smooth when I'm running it from the PC, but as soon as I put the .apk file in the device and make it run independently it behaves erratically.
It opens random pages on Button Click which are supposed to appear after a few frames. My best guess is that incorrect intent passing etc is causing this and that's why I'm tagging this question with Intents.
Can this be happening because I am not firing Intent.FLAG_ACTIVITY_CLEAR_TOP while I'm moving from activity A ->B but only when the user presses the back button B -> A.
Any help here is appreciated !!
PS: Though I don't see the need for any code, please comment in case someone needs to see it.

What is a "slider interrupt" on Android

I feel like an idiot for having to ask this question, but I have no idea what a slider interrupt is on Android, and a search of Google and Stackoverflow turned up nothing. Amazon sent me a rejection notice for my app because all of the activities except the main one (which they call, "pop up windows") do not respond well to a slider interrupt. I have no seekbars anywhere in the app, so that isn't the "slider" that they are referring to.
Also, one of the views in question isn't a new activity at all, but a listview. It disappears on a "slider interrupt." As far as I know, I have no control over what a listview dialog does in this case. Once I figure out what a slider interrupt is, how do I tell the listview not to close when it happens? I suppose I could track whether the listview is open and recall in onResume or whatever function handles slider interrupts. But without knowing what a slider interrupt is, it makes testing difficult.
I had the same problem with Amazon. I filed a ticket and here is the response:
A slider interrupt occurs on devices with a flip-out keyboard. While the app is running the keyboard is flipped out.

Android app Stops and starts on its own

Can anyone help with my android app. I am using eclipse and it is a lengthy page app. At page 18 is tells me that it stopped unexpectedly but after you hit the force close button it starts at the same place and it works correctly.
It is a simple quiz app with back and next buttons. This is the only button that wont work on the first try but as I said after you hit force close the app starts up at the same place and the button works just fine. Then you can also go back and forth over that same page without a problem...what gives?
user1009028, we need more information to be able to know for sure what is going on.
Sometimes, for mysterious reasons, the app seems to "crash" and yet still run. There are a number of possibilities here.
If you can post your full code online somewhere, that is great, but even just the logcat will be useful. Since you know how to reproduce the error, get to the page just before the crash, clear your logcat, then go to the next page so it crashes. Then copy and paste everything in your logcat to here in Stack Overflow; that will be the most relevant information related to the crash, which may or may not give enough detail--at least we'll know what to ask for then :)
Regarding your question on "com.csg.SlideNineteen#405761f8", the default toString on objects gives the class name and its address in memory. The numbers at the end are the address of the object in memory... not very useful in most cases.

Categories

Resources