You can use the v7 palette support library. It includes the Palette class, which lets you extract prominent colors from an image.
https://developer.android.com/reference/android/support/v7/graphics/Palette.html
Example

build.gradle
compile 'com.android.support:palette-v7:23.4.0'
Activity or fragment
public void updatePlayerBar(Bitmap bitmap) {
Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {
public void onGenerated(Palette palette) {
Palette.Swatch swatch = palette.getVibrantSwatch();
if (swatch == null) swatch = palette.getMutedSwatch(); // Sometimes vibrant swatch is not available
if (swatch != null) {
// Set the background color of the player bar based on the swatch color
mContent.setBackgroundColor(swatch.getRgb());
// Update the track's title with the proper title text color
mTitle.setTextColor(swatch.getTitleTextColor());
// Update the artist name with the proper body text color
mArtist.setTextColor(swatch.getBodyTextColor());
}
}
});
}