Misplaced Layout after "home"-button and/or powersave screen - android

I have an app which also includes a service with a Notification.
Right now I am experiencing the foillowing problem :
I start my app which will work fine
after couple of minutes the powersave kicks in and I get a black screen
I (or hte user) click the Menu-button to dismiss the black screen and to unlock the screenlock
Now my (fullscreen) app will have "moved" like 30-40 pixels downwards, creating an ugly black border or hole. When I move the scrollwheel it will move up and down, and when I press the Menu button (showing my ap''s menu) it will "fix" the view...
or
I start my app which will work fine
I press the Home button exiting the app, my service though will (correctly) keep running
when selecting my service from the notification-bar I will get once again :
-Now my (fullscreen) app will have "moved" like 30-40 pixels downwards, creating an ugly black border or hole. When I move the scrollwheel it will move up and down, and when I press the Menu button (showing my ap''s menu) it will "fix" the view...
Any idea what the problem is ? The app is running on a ADP2 with Android 1.6
Thanks in advance !
Ok, after some testing I noticed that if I don't run the Activity on Fullscreen, but just leave the TtileBar away this won't happen...
Still this is no solution to me, I want it to be fullscreen...
Noticed siomething else, when I have the View with the black bar, and I press the home button it will "refresh" the View correctly just before actually going to the Home Screen :(

Related

Android app changes home screen on suspend

When I suspend my app by pressing the home button, the app immediately disappears revealing the home screen. The top-most icon on the home screen is drawn inside a white shaded box, as if the icon is somehow selected. This happens before onPause() is run but does not happen if finish() is run.
This only happens with my app. I've seen it on Android 6 and 7. What could I be doing to cause this?
More information:
I can prevent this from happening if I activate a popup menu before pressing the home button.
Still more information:
Removing the 4th line makes the problem go away. This is a TextView.
curTitle.setFocusable(true);
curTitle.setFocusableInTouchMode(true);
curTitle.requestFocus();
//curTitle.requestFocusFromTouch();
I still don't understand it.
Thanks.
https://i.stack.imgur.com/sWJCQ.png

How to prevent user from clicking Navigation buttons in Android

I have encountered a problem where user will exit my application accidentally. I know Android is preventing to block use of these buttons, because you should always be able to exit your app somehow but I am creating an app for blind and visually impaired people and I will implement a special exit the app so they won't close it when they will be using it.
Here are some things I gathered:
I can block the onBackPressed() function and prevent going back.
I can't use onKeyEvent() since it won't grab the home click
Good example is MX Player where you can "lock" your screen but it just draws over the whole screen, thus preventing user to click on anything.
Ok, so I would like to grab the same thing as MX Player, except, I would like for user, to still have interaction with the screen.
I tried using Immersive full screen that Google has introduced for full screen apps, but whenever user slides his finger on the screen, Navigation Menu popus up. Can I keep this hidden at all times? Also, can I prevent the slide from Status Bar to display the buttons? I would like to have full control of how the user is moving their finger over the screen.
So if I go back to the MX Player solution - drawing over the screen. Can I create like a Canvas that doesn't have focus and it's just there to prevent the clicks on the buttons?
Any help is very much appreciated. Thanks.

Animated Android View with EditText

For the app I'm working on, the signon screen (the main activity) has some animations. Several of the signon related controls (the EditText, an application banner image, the signon button, locked out link, etc) are wrapped into a LinearLayout that starts out centered in parent within a full screen RelativeLayout. When the user taps into the EditText, the animation fades out the banner image as the logon form translates to the top of the screen. When the user dismisses the keyboard the banner image fades in as the form slides back down to the center of the screen.
The two issues are as follows (the first one is the most important since I don't have a workaround for it right now):
When the user is typing into the EditText after it's been animated to the top (it isn't actually animated to the top, the containing LinearLayout is) then you almost never see any text that is typed. It's random... sometimes the hint stays there and sometimes you might see a letter or two. When the keyboard is dismissed and the animation moves everything back to the start, the text is visible. Why?!
When the signon screen is put into the background and then resumed, Android appears to show some cached version of the screen where the controls are in their "focused" state but none of them work. Tapping on the screen where the controls would normally be (in the center) reveals the controls and starts the animation to move them to the top. This happens even if when the screen goes into the background, it's in it's regular state. I "fixed" this by setting a flag when the activity is paused and then checking if the flag is set in resume... if it is then I recreate the activity (by launching a new intent, not by calling recreate since I have to support an older API). It would be awesome if it just didn't show the cached version without me having to jump through these hoops.

Fix "scroll up" bug in Eclipse logcat?

I was wondering if you had a way to fix the scrolling glitch with Logcat on Eclipse. Whenever I try to scroll up, the screen moves up for a sec and then goes back to the bottom.
It is really annoying and I can't get to some of my errors because of it.
You should use the Scroll Lock button.
Also, consider using the corresponding LogCat filters in order to only display the messages you are interested in.
I've experienced this as a error. Unselecting the scroll lock button will not work 99% of the time. As soon as you try to scroll the window (with mouse wheel or clicking the scroll bar up/down arrows) the scroll lock, turns back on.
Solution:
I've found a workaround, after unselecting the scroll lock, then click on a message and then press the page up key on your keyboard once and this will release the lock completely. You can now scroll with the mouse wheel and scroll bar arrows. This works for me on Windows 7.

Visual effects, and Activity redraw after pressing home button and come back

I am programming an Android app and it seems to work well, but when the user presses the 'home' button, and after returns to the app, the activity has changed his position some pixels, and due to this some buttons are hidden.
It only happens in some phone models , and only with visual effects enabled on the operating system.
It seems that the activity is drawn before the top bar of Android dissapears (the bar with the battery info, wifi... etc), and the activity starts to draw under the place of this bar.
What can be happening? how can I solve it?
Thank you very much!
PD: I am using a relative layout on this activity, and some layouts inside placed at top and bottom.
PD2: I forgot to tell that the app is in "no tittle bar and fullscreen".

Categories

Resources