Android ListView not being repainted on scroll - java

This is best described with pictures. Before scrolling in my ListView, everything looks fine:
After scrolling:
What could be causing this odd behavior? I am testing it on a Google Nexus running Android 4.2.2 and have tried it on the emulator running Android 3.2 with the same result. In this example I am using a ListView with two types of rows, but I get the same result with a standard ListView with just one row type.

It turns out the problem was that I did not set a background color in my layout XML file... If someone could explain to me why this fixes the problem, I would greatly appreciate it. Adding
android:background="#000000" to my main layout fixed it, though.
....

Related

Skobbler Maps. Annotations appear as black squares. Android

I'm developing an Android app that shows my different POIs with my custom design.
Usually In most cases everything is fine. But sometimes, about 5% cases there are black squares instead of my POI.
Check the screenshot please:
https://www.dropbox.com/s/tlqqczq98w926oi/ss1.jpg
I'm using for this SKAnnotationView.setView passing my custom View object with ImageView. Image can be set to ImageView via setImageBitmap in background or via setImageResource. I tried different ways. And there is no difference with choice of Bitmaps or Resources. In both cases black square can be shown.
Why it could happen? I don't see anything strange in logcat. No error messages, no warnings.
I'm checked for sure that SKMapSurfaceView.addAnnotation method is called from UI thread. Always.
I'm using Skobbler Android SDK 3.0.3.
How can I correct this issue? Or how can I detect the problem that cause this behavior?
Thanks in advance.
This issue was fixed with the latest SDK release (3.1).

Android Studio: View who is visible only in preview

I have a simple question. I'm making application in Android Studio and I have got a problem. My application is creating buttons using Java. I want see these buttons in Preview editor, because I want have easier posibility to editing layout. So I made the same buttons in XML, but here is the problem. When I build my app it is showing both buttons! I want see only the buttons creating by Java code and finally here is my question it is possible remove buttons created in XML? I was thinking about tools:.. but I didn't find any usefull tag. Someone have any idea?
You can use tools:visibility="visible" and android:visibility="gone" together, so they show in the preview, but they're gone when the app is running on a device/emulator.
As already mentioned, you use tools:visibility="visible" in combination with android:visibility="gone" to render any view in preview but not in the build.
Using removeView(someChildElement) on your layout will remove the element you don't want. AFAIK, the XML code will still be there in the APK, but it isn't there at all in the built APK.
I have no clue why you want to show them in preview and not in the finished result. If it is because you want to toggle them manually later, you don't need any XML code. You can also do:
someView.setVisibility(GONE)
And a quick reference:
Visible - the view is visible
Invisible - the view is invisible, but still takes up space
Gone - the view is invisible and takes up no space
You cannot remove the code from the XML file on build though.

Glide is not loading properly on Android

I am doing Popular-Movies project stage ONE! I have one problem by using Glide Library to load the picture from TheMovieDB API.
I am using a recylerview adapter to display my data model in a Grid layout. Everything works very well except by loading some posters into the Gridlayout that some of them haven't been loaded properly. Please take a look at my screenshot and let me know if you come up with some idea.
by adding "fixedsize" and "cachesize" to my recyclerview that solve my problem, but I think I have go to find that how I can solve the problem for the dynamic environment.
recyclerView.setHasFixedSize(true);
recyclerView.setItemViewCacheSize(20);

Enabling EditText corrupts RecyclerView items

I have a problem with flickering RecyclerView items when my EditText is enabled.
When I disable the EditText, everything is fine:
But when I enable it in the XML (android:enabled="true") or with code (setEnabled(true)) the RecyclerView items go white or pink, depending on the EditText focus:
This happens only on some devices and never on the emulator.
In the Google Play Developer Console report, only the screenshots taken on Nexus 5 had this problem.
I also have Nexus 5 device (the older one) and it's there as well.
I'm not posting any code right now as I think it doesn't matter since it happens just by enabling the EditText.
Have you seen something like this? Do you know what causes such effect?
Edit 1:
As you can see, also the Spinners get corrupted.
Edit 2:
I have uploaded the whole repository to a temporary public project: GitLab
(Look for RatesFragment.java and res/layout/fragment_rates.xml)
The code is a mess right now. I was experimenting with a few approaches and ended up with this issue in the middle of the night.

App not working on certain phones

People have been experiemcing a problem with my android app. Apperently what is happening is on phones such as the Droid x and cliq cupcake have been experiencing the main menu not showing the letters on the buttons and in some occasions it will cause a force close in certain sections. My buttons do have picture backgrounds if that could be the cause and the app is set for version 1.6. Not sure if either has anything to do with it. If anyone has experienced it or has any ideas I would appreciate some help. Thanks alot
It should work on every phone if you read this post carefully
http://developer.android.com/guide/practices/screens_support.html
In best practices part recommended list is here.
Use wrap_content, fill_parent, or the dp unit (instead of px), when specifying dimensions in an XML layout file
Do not use AbsoluteLayout
Do not use hard coded pixel values in your code
Use density and/or resolution specific resources
Every android developer should read that post to support for multiple screens.
Hope this helps

Categories