Why this line xmlns:android=“http://schemas.android.com/apk/res/android” must be the first in the layout xml file?

Why is this line needed in xml layout file? xmlns:android=”http://schemas.android.com/apk/res/android”

what is the difference between sendStickyBroadcast and sendBroadcast in Android

What is the difference between sendStickyBroadcast and sendBroadcast in Android?

Android: ProgressDialog.show() crashes with getApplicationContext

I can’t seem to grasp why this is happening. This code: mProgressDialog = ProgressDialog.show(this, “”, getString(R.string.loading), true); works just fine. However, this code: mProgressDialog = ProgressDialog.show(getApplicationContext(), “”, getString(R.string.loading), true); throws the following exception: W/WindowManager( 569): Attempted to add window with non-application token WindowToken{438bee58 token=null}. Aborting. D/AndroidRuntime( 2049): Shutting down VM W/dalvikvm( 2049): threadid=3: thread exiting […]

Disable activity slide-in animation when launching new activity?

I have an activity which launches another activity, via a button click. By default, on newer OS versions of android, the OS will animate the new activity sliding in from right to left. Is there a way to disable this animation? I just want the new activity to appear without any sort of animation.

Working with Enums in android

I am almost done with a calculation activity I am working with in android for my app. I try to create a Gender Enum, but for some reason getting Syntax error, insert “EnumBody” to complete EnumDeclaration. public static enum Gender { static { Female = new Gender(“Female”, 1); Gender[] arrayOfGender = new Gender[2]; arrayOfGender[0] = […]

Android read text raw resource file

Things are simple but don’t work as supposed to. I have a text file added as a raw resource. The text file contains text like: b) IF APPLICABLE LAW REQUIRES ANY WARRANTIES WITH RESPECT TO THE SOFTWARE, ALL SUCH WARRANTIES ARE LIMITED IN DURATION TO NINETY (90) DAYS FROM THE DATE OF DELIVERY. (c) NO […]

GoogleService failed to initialize

I am using google Maps in my android application. I have created the key and added necessary permissions in manifest file. But soon I start the application I get this message in debugger: GoogleService failed to initialize, status: 10, Missing an expected resource: ‘R.string.google_app_id’ for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services […]

How to change status bar color to match app in Lollipop?

In the new lollipop update I noticed that with the native Google apps the color of the status bar changes to match the action bar on the app you’re running. I see it’s on the Twitter app also so I’m guessing it’s not exclusively Google who can do it. Does anyone know how to do […]

This app won't run unless you update Google Play Services (via Bazaar)

I’m testing out the new Google Maps API V2 for Android, and I’m getting this message when the app launches: This is running on an 4.1 emulator. Here is my AndroidManifest.xml file: <manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”com.example.maptest” android:versionCode=”1″ android:versionName=”1.0″ > <uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”15″ /> <permission android:name=”com.example.maptest.permission.MAPS_RECEIVE” android:protectionLevel=”signature”/> <uses-permission android:name=”com.example.maptest.permission.MAPS_RECEIVE”/> <uses-permission android:name=”com.google.android.providers.gsf.permission.READ_GSERVICES”/> <uses-permission android:name=”android.permission.INTERNET”/> <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE”/> <uses-permission android:name=”android.permission.ACCESS_COARSE_LOCATION”/> […]

View inside ScrollView doesn't take all place

I have a RelativeLayout inside a ScrollView. My RelativeLayout has android:layout_height=”match_parent” but the view doesn’t take the entire size, it’s like a wrap_content. Is there a way to have the real fill_parent/match_parent behavior ? My layout : <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent”> <ImageView android:id=”@+id/top” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:layout_alignParentTop=”true” android:scaleType=”fitXY” android:src=”@drawable/top” /> <ImageView android:id=”@+id/header” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:layout_below=”@+id/top” android:scaleType=”fitXY” […]

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