I am new to android. I am trying to use vector drawables in my application. The below code works fine till Marshmallow version. Also works fine on lower versions. But as soon as I run it on Nougat the image gets blurr.
My build.gradle (project)version is 2.0+ and have added below code in my build.gradle (app)
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
minSdkVersion 15
targetSdkVersion 25
vectorDrawables.useSupportLibrary = true
}
Support version is:
compile 'com.android.support:appcompat-v7:25.3.1'
Also I have added the below code in onCreate method
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
In my XML:
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
app:srcCompat = "@drawable/ic_camera_black_24dp"/>