📅  最后修改于: 2022-03-11 14:58:54.390000             🧑  作者: Mango
You can use TextUtils utility method like this,
if (!TextUtils.isEmpty(content_id) && TextUtils.isDigitsOnly(content_id)) {
ids[0] = Integer.parseInt(content_id);
} else {
ids[0] = 0;
}
and while setting content_id you can set like this, content_id = message.getContentId().toString(); instead of content_id.valueOf(message.getContentId().toString()) ;