Gson 2.2.2 causing a stackoverflow on 4.2.1 only

I am developing an app for android which downloads points of interest from a server using JSON strings. Everything was working fine but since I have started testing on 4.2.1, I have been getting the following error: 01-28 15:32:14.167: E/AndroidRuntime(31174): FATAL EXCEPTION: AsyncTask #1 01-28 15:32:14.167: E/AndroidRuntime(31174): java.lang.RuntimeException: An error occured while executing doInBackground() 01-28 […]

android 9 patch drawable xml

Is there a way to define a 9 patch drawable in an android xml file? The reason I ask, is that when you apply a scale animation to a drawable w/ a stroke on it, the stroke appears to thicken. I’d like to make the stroke stay the same size as the animation plays…

Move Events AFTER LongPress

How can I listen the move events after the LongPress is caled in my GestureDetector? When the user LongClick he starts the selection mode, and can drag a square into the screen. But I noticed that the onScroll is not called after LongPress is consumed.

Why does Kit Kat require the use of the isValidFragment?

Ever since KitKat was released, I’ve noticed a whole bunch of my apps updating with “Fixing a crash in Kit Kat”. Recently when I released my own app, I figured out the likely source of that is the new “isValidFragment” requirement for using preference activities. I haven’t been able to get anyone, however, to explain […]

Getting “Fragment did not create a view” after adition of other Fragment without UI

I’m having a really weird problem. I have a common fragment that is added in almost every activity of my app. This fragment shows a small version of the player bar. So it listens some broadcasts to update the current music’s name and has some controls, like play/pause. Like I said, I add this fragment […]

How do I change the color of a selected item on a ListView?

I’m creating a ListView that has some simple items inside a ViewCell. When I select one of the items it becomes orange. When I click and hold (to open the context actions) it becomes white… <ListView ItemsSource=”{Binding Items}” HasUnevenRows=”True”> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <ViewCell.ContextActions> <MenuItem Text=”Delete” /> </ViewCell.ContextActions> <StackLayout Orientation=”Horizontal” Padding=”20″> <StackLayout HorizontalOptions=”StartAndExpand”> <Label Text=”{Binding Name}” […]

Android : Html Anchor Link works only once in webview

I am facing some strange issue in webview at time of loading html content with anchor link. Following code works perfect for anchor tag but only once. Second time when i press anchor tag it is not working. protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mywebview); String html = “<html><body><p><a href=’#C4′>See also Chapter 4</a></p><p><h2>Chapter 1</h2><p>This chapter […]

Android ViewFlipper Animation

I’m stuck on a simple problem which is driving me nuts. Basically I have 2 ImageViews, I’m trying to have the first show for a second, then fade out to show the second. I’ve been looking into using ViewFlipper, example code below, but the animation is non-existent. ViewFlipper mFlipper = new ViewFlipper(this); ImageView i = […]

onTouchListener for entire screen

I have a screen filled with buttons, but want the onTouch-method to use the entire screen’s coordinates. I first tried using a RelativeLayout with an onTouchListener, but never managed to make it “connect” with the listener (i.e. nothing happened when screen was touched), I also tried putting an ImageView on top of the screen, and […]

Change font style in Action Bar Tabs using Sherlock

I’ve read this: Android – customizing actionbar sherlock tabs And many more links, I’ve figured out what is StackedBackground and what is Background, but I can’t find how to remove All Caps from Tabs and get regular fonts, or change font size in action bar tabs. Beside that, I’d love to change color of my […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.