How to have Android Service communicate with Activity

I’m writing my first Android application and trying to get my head around communication between services and activities. I have a Service that will run in the background and do some gps and time based logging. I will have an Activity that will be used to start and stop the Service. So first, I need […]

How to inflate one view with a layout

I have a layout defined in XML. It contains also: <RelativeLayout android:id=”@+id/item” android:layout_width=”fill_parent” android:layout_height=”wrap_content” /> I would like to inflate this RelativeView with other XML layout file. I may use different layouts depending on a situation. How should I do it? I was trying different variations of RelativeLayout item = (RelativeLayout) findViewById(; item.inflate(…) But none […]

Use URI builder in Android or create URL with variables

I’m developing an Android app. I need to build a URI for my app to make an API request. Unless there’s another way to put a variable in a URI, this is the easiest way I’ve found. I found that you need to use Uri.Builder, but I’m not quite sure how to. My url is: […]

Rendering Problems Exception raised during rendering:

I encountered a problem when creating a project in Android Studio. (Version 1.5.1) I describe my actions step-by-step: Open Android Studio. Create a new project without any activity. Make a blank activity. And there might be a problem in preview mode: I get this message: Rendering Problems Exception raised during rendering:;)Lorg/xmlpull/v1/XmlPullParser; In stack trace: […]

Resolved versions for app (22.0.0) and test app (21.0.3) differ

After upgrading to API 22 and support lib revision 22 I’m getting the following warning: Warning:Conflict with dependency ‘’. Resolved versions for app (22.0.0) and test app (21.0.3) differ. Gradle itself is more forgiving, but Android Studio, not so much. I have no dependencies declared with 21.0.3 … is one of the dependent libraries using […]

ArrayIndexOutOfBoundsException with custom Android Adapter for multiple views in ListView

I am attempting to create a custom Adapter for my ListView since each item in the list can have a different view (a link, toggle, or radio group), but when I try to run the Activity that uses the ListView I receive an error and the app stops. The application is targeted for the Android […]

Meaning of Choreographer messages in Logcat

This question already has an answer here: The application may be doing too much work on its main thread 11 answers

How can I make a horizontal ListView in Android?

Possible Duplicate: Horizontal ListView in Android? Like many things in Android, you wouldn’t think this would be such a hard problem but ohhh, by golly, would you be wrong. And, like many things in Android, the API doesn’t even provide a reasonably extensible starting point. I’ll be damned if I’m going to roll my own […]

How to adjust text font size to fit textview

Is there any way in android to adjust the textsize in a textview to fit the space it occupies? E.g. I’m using a TableLayout and adding several TextViews to each row. Since I don’t want the TextViews to wrap the text I rather see that it lowers the font size of the content. Any ideas? […]

How to programmatically open the Permission Screen for a specific app on Android Marshmallow?

I have a question regarding the new Android Marshmallow release: Is it achievable to display the Permission Screen for a specific app via an Intent or something similar? It’s possible to display the app settings with the following code – is there an analog solution for directly opening the Permission Screen? startActivity(new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.fromParts(“package”, getPackageName(), […]

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