When a webview is done loading it only shows a white page. The strangest part is that events (like a click on an anchor) are still working. After i perform this event and go back (with the back key), the webview is rendered correctly.
This behavior doesn't appear on a HTC Desire with Android 2.3.7, but it appears on the Asus Transformer Prime with Android 4.0.3.
If i put a Thread.sleep(10000) in onPageFinished() the page is visible for 10 seconds but then turns white, events are still working.
The Activity is the Launcher activity and extends a custom base activity. Every activity in my app extends this base activity. The base activity detects if a user is authorized and shows the login activity is needed. When i press the back button after the login activity is displayed, the launcher activity is shows the behavior as described above.
Don't know what to do right now to solve this problem...
The easiest way is to say that it is a bug in Android. But that doesn't solve my problem. Any suggestions to solve this case?
I have had the same problem for a couple of hours, what solved the problem for me was removing the setting below from my WebView constructor call:
this.setLongClickable(true);
I do not know why this worked.
Related
I have an APK that runs completely fine across several android levels varying from android 5 through 9. We started testing a new android 9 phone (Hot Pepper HPP-L55B aka Serrano), and I'm seeing an interesting issue that I'm hoping someone has come across.
All of my Activities extend a base activity that does some standard logging (such as logging onCreate, onResume, etc).
On app launch:
Activity 1 - MainLaunch
onCreate starts the activity Splash then calls finish
Activity 2 - Splash
onCreate sets the content view and finds the WebView on the screen.
onResume sets a gif in the webview so it's rendered on the splash screen. It also starts a thread that sleeps for a few seconds that then kicks off Activity 3. The gif animates as expected.
Activity 3 - Launchpad
onCreate sets the content view and finds references to other items on the screen (buttons and textviews).
onResume checks a few internal things, and may or may not hide things on the UI based on configuration. Nothing to exciting.
There are times this process will go through without a hitch, and other times where the UI that was being displayed in Activity 2 (splash) stays up while my logs are showing that the code thinks it's showing UI 3. The gif in this case is no longer animating.
As you click around on the splash screen the buttons that are referenced and would be showing on Activity 3 are being pressed. So basically like the splash screen is covering the 3rd activities screen and allowing button push pass through. If i turn the screen off/on again the splash screen still shows up. Throwing breakpoints in activity 3 get hit as the hidden buttons get clicked.
Anyone ever see this before or have suggestions how to fix it? This phone model seems to be the only one with the issue. So it definitely seems like a phone model problem and not anything i can control. Any suggestions?
This problem boiled down to the processor (MediaTek) being used in combination with the theme being used for the application. At least that was the only thing that was found different across the supported phones we tested.
The theme for the activities were changed:
from #android:style/Theme.Translucent.NoTitleBar
to #android:style/Theme.Light.NoTitleBar
I have one big and long question
I have one activity with 4 fragments using viewPager.
the first fragment also has 4 fragments using viewPager
the second fragment has 6 fragments using general fragment way (replace or add on framelayout)
Here are my question and problem
For example, I am in the first tab and in the second fragments, then hit homebutton and then bring my app upfront. after that suddenly all functionalities are not working. the back button is not working. the button in the fragment is not working. (error log said the fragment is not attatched)
it happens only on pixel3.
I have 5 different android phones but working fine on those phones.
I thought it could be the memory issue, so I turned on "profiler" from Android Studio, and I saw the weird thing. only pixel3 when I pressed the home button the activity is destroyed. I tested all other phones with "Profiler" the activity's state is saved not destroyed.
Does anyone have the idea of why it happened and fixed the problem?
Are the embedded fragments problem? or is it OS10 problem?
I found the issue. there is one option in developer mode named "Don't keep activities". that was on, that is why my app is working differently on pixel3.
I have spent quite a while trying to get rid of this flicker and was hoping someone could point me in the right direction. Not sure what code to post so if you don't mind i will post whatever is asked for.
The issue is that when i press back or home the activity closes but then for a split second it flashes (flickers) back on the screen then is gone again. sometimes the flicker is very quick and not very noticeable but other times its a little longer (maybe a full second).
It happens on emulator and actual device. Happens on Android 4.4+, Android 5.0+ and 6.0+ Devices
I have tried removing things from manifest, styles, onbackpressed, onpause, onstop, etc...
What i have is a AppCompatActivity with many fragments. Im using the Theme.AppCompat.Light.NoActionBar theme and a toolbar with navigation drawer.
Like i said i know im not posting much code but not sure where to start. I have searched this site for this issue and can't find anything related so not sure what parts of my code to post.
You can try calling
overridePendingTransition(0, 0)
when your main activity finishes, i.e, in either of the onPause() or onBackPressed() method of your AppCompatActivity. Also make sure all your fragments are getting destroyed, you may have to manually remove the fragments by calling
fragmentTransaction.remove(fragment).commit()
I am using the Launcher 3 code as a base for building my own launcher application. I've managed to build everything correctly and import the project in Android Studio, however I seem to have some issues when switching into landscape mode on a Nexus 7 (first generation) device.
The problem is that at first the Google search and voice search icons do not appear but after pressing the home button they do. Also if you tap on the places where they should be, the search activity appears and when coming back to the launcher the buttons are there too. It seem that somehow they are not visible and I have looked over in the code but so far I could not find what the issue is.
Is there any one who encountered this problem and can point me in the right direction to solving it?
Thanks,
Mihai
I have managed to solve the problem.
It would seem that the drawableStateChanged() method from HolographicImageView is called when switching to landscape mode before the view is laid out. This would cause the mStatesUpdated flag set in the method generatePressedFocusedStates(ImageView v) in HolographicViewHelper to be set to true and the code updating the search bar ui would not be executed anymore in the subsequent calls of the generatePressedFocusedStates(ImageView v), after the view is laid out.
A simple check for isLaidOut() before calling generatePressedFocusedStates(ImageView v) in the drawableStateChanged() method would do the trick.
I have built a game. When the user clicks a button on the main page, he is redirected to another activity for a predefined time(say 20 s) and then he returns to the main page where he can choose another button. Now, this works perfectly on the emulator but on the phone when I clicks another button on the main page, it says the application has stopped unexpectedly. Force close. However, if I wait for say 3 s before clicking another button, it works. Is it because the images on the background of the buttons are too heavy?? Kindly help. Thanks in advance.
hey! i found out what was wrong. There was one picture which was too heavy!! it works fine now :)
Sometimes this error results from the widget like textview and so on, please delete the line related to something like textview.