I'm developing an android app. So far I've been testing everything on my Galaxy Nexus with android 4+. I've done all my programming with backwards compatibility in mind.
I'm very close to release, and want to make sure that it runs okay on API 9+. Since I don't have a real android 2.3 phone, I'm using the emulator.
Everything seems to work fine, but the layout is sometimes okay, and sometimes completely garbled!
The background is horrible, and TextViews are a lot of times missing. But sometimes they're okay for just a few moments before garbling up.
How reliable is this emulator? Is this how it would really look if I ran it on a real machine? What can cause this?
EDIT:
The layout in the screenshot is made up of 7 small ViewGroups containing ListViews.
This is the code for the main background drawable (the blue-green-gray garbled one):
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="#drawable/main_bgtile"
android:tileMode="repeat" />
EDIT2:
I also noticed that when a transaction animation when switching fragments is played, the fragments look perfect for the duration of the animation, and then re-garble when it's done.
EDIT 3:
My logcat seems to be flooded with the following error:
10-09 00:41:40.385: D/skia(327): SkGL unimplemented: stroke path
A few dozens of those. What should I do to fix this?
Thanks
I solved it:
I'm using actionbarsherlock; and for some reason I decided to disable the actionbar in the style, but then re-request it in the activity.
By removing this line from my onCreate() method in my activity, I was able to solve the problem:
this.getWindow().requestFeature(Window.FEATURE_ACTION_BAR)
Related
I have a problem with the "pixelization" of the embedded icons (main/res) on some devices. It can be reproduced on some Android 9 TV boxes and it happenes when an icon is upscaled/downscaled somehow (see images as example). But I do not know why it happens. And I can not reproduce this bug on any devices of mine and on any Android Emulator. I am using regular Android resources (R.drawable) in an XML layout. As I can see, it is not an anti-alias problem. Also, the same APK works great on the other TV boxes. This problem was reported by the user and as I said - I can not reproduce it. These resources were set just via android:src in ImageView, nothing special.
What I need to check first? Thanks.
Example of the pixelization:
https://i.stack.imgur.com/k76jx.png
https://i.stack.imgur.com/Tp8iX.png
UPDATE:
I tested this behavior with the user on his TV box: it happens only with SVG(VectorDrawable) graphics and with android:hardwareAccelerated="true" (it is true by default). If I set android:hardwareAccelerated="false" everything works as expected. Any solution for this?
android:resource="#7F160010" />
So I have this situation where I can't seem to get android studio to show my navigation graph layout visualization. Navigation editor used to work normally when there were 10 or so screens, but as I kept adding screens I started to notice that my editor would stop working and I would have to invalidate caches and restart for it to work again. But as I added even more screens to the graph, I can no longer get it to work. And to make matters worse, if I accidentally open navigation.xml, all layout preview windows stop working which is getting really annoying. I tried allocating more memory for android studio, but that didn't seem to help. I have layout attributes on each fragment/dialog and I can see placeholders in preview, but it just won't render layouts.
Any ideas?
EDIT: this happens in AS3.5. Things get worse with AS3.6 preview as no graph is rendered at all.
Screenshot of current graph:
I would suggest refactoring some smaller, logically related sections of that navigation graph out into nested navigation graphs. You can use an <include app:graph="#navigation/nested_graph" /> tag much like you can do with layouts. I recommend trying to pull out smaller features wherever it makes sense in your code.
This doesn't fix the problem of Android Studio not being able to handle a graph of that size, but it should work around it.
I've just started to rebuild my app for Android 5.0, using the appcompat support library. I've just finished implementing a transition featuring shared elements. It seems to work well, untill I add a webview.
I've made a video to demonstrate the glitch.
https://www.youtube.com/watch?v=MuuGZc0Vwow
As you can see, all's fine when I open the activity. When I close it, the glitch occurs. As you can see all elements fade out like they should, except for the webview. Which just hangs there until the animation is over, kinda ruining the entire smoothness of the animation.
How do I fix this? If it could be related to the way I've set things up I'd be happy to share some code.
Thanks in advance.
The reason why this glitch occurs is because WebView extends AbsoluteLayout. By default ViewGroups that are not "transition group"s and that have no background drawable will not be animated by the activity's window content transition. In order to fix the glitch with the WebView, you will need to call webView.setTransitionGroup(true) (or set the attribute in XML using android:transitionGroup="true"). This should cause the WebView to fade away as part of the activity transition instead of simply sitting there until being abruptly removed at the end of the transition.
As for the "Unable to create layer for WebView" error you are receiving, I imagine that is because the transition framework automatically creates a hardware layer for the WebView during the transition and for some reason the framework is crashing when it is trying to create the layer. This sounds like a totally separate issue related to Android's internal graphic pipeline though... I'm not sure I can give you a good answer about why the crash occurs without more information.
This issue is also discussed in the bottom of this blog post.
I have facing exactly this kind of random crash problem in webview in Marshmallow version. I have add attribute android:transitionGroup="true". but crash is happening, after that i have added android:hardwareAccelerated="false" in manifest where that activity is declared. After that random crash has solved in Marshmallow version and lower version too.
i'm trying to build an android app which uses google maps with the support fragment libraries, everything was going fine until i tried to implement my own sliding menu, which didn't seem like a big task, i just put it behind the main activity fragment, and when i want to show it i slide the main screen to the right.
sounds simple enough right? well it was all working fine except for one thing, whenever i tried to apply translation (may it be in animation or without) the layout would start flickering non stop, i have no idea why this happens, i tried to do it in several ways but the main issue remained, whenever i use translation, the layout would flicker and other layouts too.
another thing to note is that i have Samsung Galaxy S2, i tried to run the app on my friends HTC and it worked fine, plz help!
heres a video:
http://www.youtube.com/watch?v=ICpu5s5r7xE
i solved this by adding a transparent imageView on top of my map, i guess it forced a different kind of redraw to the screen, this idea wasn't mine, i got it from a different google maps related problem, this is how my xml looks now (part of it)
<fragment
android:layout_marginLeft="-40dp"
android:layout_marginRight="-40dp"
android:id="#+id/map_fragment"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
<ImageView
android:id="#+id/map_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/transparent"
/>
hope this helps! :)
I had a similar problem like that a while ago (it was flickering just while moving). Try writing this code in the manifest for your fragment activity:
android:hardwareAccelerated="false"
because of android version differences, this flickering is happening. If your activity is not so intense you can solve like this. But if it becomes too slow, either you will declare version check and apply this programmatically for different apis, or finding another solution.
I'm trying to create a ViewPager that takes up the entire screen. Inside each fragment of the ViewPager, I have an ImageView that displays a semi-transparent picture.
For some reason, when I try my solution on a Galaxy Nexus (4.0.4), it leaves a border on the left and right side of the ViewPager, as shown below:
I've tried this on the following devices and it does not give that problem:
Nexus S (4.1.1)
Nexus One (2.3.6)
Evo 4G (CM7.2, 2.3.7)
Android emulator
Would anyone be able to take a look at the simplified source code and help me out (especially if you have a Galaxy Nexus)? Thanks!
Btw, this is an attempt to solve an earlier question myself, for which I couldn't get a proper answer.
I went through my code again and tried commenting/uncommenting sections to see if I could get rid of the problem.
I narrowed it down to the custom style I was applying to my activity. In it, I had the following item:
<item name="android:windowIsFloating">true</item>
Removing this item fixed the issue, although I still don't understand why. Maybe something related to this question - How to create a transparent activity WITHOUT windowIsFloating
I had originally included this item after reading the following question -
How do I create a transparent Activity on Android?
Anyway, I hope this saves someone else a significant amount of time in debugging.