OnCompletion listener with MediaPlayer

How do i use the OnCompletion listener for some music? I would like to press a button to go to another activity that plays some music and then goes back when the music playback is finished. I allready coded the other stuff. I just cant figure out how to use the OnCompletion listener?

debugging android app via eclipse on bluestacks app player

I have read a few articles that BlueStacks App Player can be used to debug android apps via Eclipse, instead of the default android emulator. Example article But I think this refers to the Windows version, I was unable to get to it work on MacOS. Does anyone know how to debug using BlueStacks/eclipse on […]

Switchcompat not displaying the Switch

I am trying to use the latest appcompat which was updated for material design in my app to show the switch view as displayed in Lollipop(http://android-developers.blogspot.in/2014/10/appcompat-v21-material-design-for-pre.html), the problem is the switch is not getting displayed. My SDKmin is 14 and max is 21. I am using the below code in the layout: <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” […]

Getview Called multiple times in android

I am working on reuse of cell and currently i am working in getview method of adapter and i got one problem that my getview method called 9 times but it should call only 5 times at the starting of app because i am displaying only 5 rows. public View getView(int position, View view, ViewGroup […]

Android appcompat v7:23

Today, Google released SDK 6 API 23+. I tried to create a project with the API 23, but I’m having the following problem: Failed to resolve: com.android.support:appcompat-v7:23.0 Here’s my gradle file: android { compileSdkVersion 23 buildToolsVersion “23.0.0” defaultConfig { applicationId “my.package” minSdkVersion 17 targetSdkVersion 23 versionCode 1 versionName “1.0” } buildTypes { release { minifyEnabled […]

The method managedQuery(Uri, String, String, String, String) from the type Activity is deprecated

When I compile the following code cursor = activity.managedQuery( imageUri, proj, null, null, null ); I get following warning The method managedQuery(Uri, String[], String, String[], String) from the type Activity is deprecated The code is working fine. What should I do to avoid this?

RecyclerView scrolled UP/DOWN listener

How do we know if user scrolled down or up in RecyclerView ? I tried with RecyclerView#OnScrollListener , it gives the amount of vertical scroll and the scroll state. How do we get the last scroll position when started to dragging and scrolled position when scroll state idle. Thank you.

Unable to resolve target 'android-17'

I know there are some sort-of duplicates of this, but none of the answers have been able to help me so far. When I open a project, I get the following error: [2014-01-07 14:18:00 – Permissions] Unable to resolve target ‘android-17’ Does anybody know what may be the problem here?

Get view of Fragment from FragmentActivity

I have a FragmentActivity where I add a Fragment. Depending on some situation, I want to access Buttons from that fragment’s layout and change click listeners of them. What I do is: View view = myFragment.getView(); Button myButton = (Button) view.findViewById(R.id.my_button); myButton.setOnClickListener(new MyClickListener()); But the view variable is always null. How can I get the […]

Check if marker is inside circle radius

I’m trying to know if a given marker is inside a circle radius. In javascript, i can do something like: google.maps.geometry.spherical.computeDistanceBetween(latLngCircleCenter, latLngPoint); But in android, using maps-v2, i’m stucked.

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