I am new to android studio and I am having a problem passing an image taken from the phone camera (bitmap) to a class that expects an image from drawable folder
My code works when Im passing image like this
personList.add(0, new Entry(R.drawable.image1, "", "", "", "", ""));
but when i try to pass an image produced by taking a photo from camera its shows an error Required type:int Provided:Bitmap. I don't know hot to fix it. is it possible? thank you
This is my class
public class Person {
private int personPicture;
private String personFullName;
private String personRemark;
private String personHobbies;
private String personGender;
private String personBirthday;
public Person(int personPicture, String personFullName, String personRemark,String personHobbies, String personGender, String personBirthday) {
this.setPersonPicture(personPicture);
this.setPersonFullName(personFullName);
this.setPersonRemark(personRemark);
this.setPersonHobbies(personHobbies);
this.setPersonGender(personGender);
this.setPersonBirthday(personBirthday);
}
public int getPersonPicture() {
return personPicture;
}
public void setPersonPicture(int personPicture) {
this.personPicture = personPicture;
}
public String getPersonFullName() {
return personFullName;
}
public void setPersonFullName(String personFullName) {
this.personFullName = personFullName;
}
public String getPersonRemark() {
return personRemark;
}
public void setPersonRemark(String personRemark) {
this.personRemark = personRemark;
}
public String getPersonHobbies() {
return personHobbies;
}
public void setPersonHobbies(String personHobbies) {
this.personHobbies = personHobbies;
}
public String getPersonGender() {
return personGender;
}
public void setPersonGender(String personGender) {
this.personGender = personGender;
}
public String getPersonBirthday() {
return personBirthday;
}
public void setPersonBirthday(String personBirthday) {
this.personBirthday = personBirthday;
}
}