This is the error line:
if (called_from.equalsIgnoreCase("add")) { --->38th error line
This means that called_from
is null. Simple check if it is null above:
String called_from = getIntent().getStringExtra("called");
if(called_from == null) {
called_from = "empty string";
}
if (called_from.equalsIgnoreCase("add")) {
// do whatever
} else {
// do whatever
}
That way, if called_from
is null, it'll execute the else
part of your if statement.