IMAGE adding in the drawable folder, this code work.
XML
android:src="@drawable/myImage"
JAVA
image1.setImageResource(R.drawable.myOtherImage);
But,
IMAGE get with android studio when i use drag and drop palette editor :
XML
app:srcCompat="@android:drawable/presence_offline"
JAVA
image2.setImageResource( ***what code here for use presence_online ?*** );
2
Answers
xml
R if you use android 11.0(R) sdk 30.
for handle Android API above 16 and above 21 use this code.