我正在尝试添加 firebase 应用程序邀请,但收到此错误(在下面提到的代码的倒数第二行中):
无法解析snackbar_layout
我已经添加了依赖项: compile 'com.google.firebase:firebase-invites:11.6.0' 。在互联网上的任何地方都找不到解决方案。请帮忙!提前致谢。
这是代码的一部分,我收到此错误:
// [START on_activity_result]
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.d(TAG, "onActivityResult: requestCode=" + requestCode + ", resultCode=" + resultCode);
if (requestCode == REQUEST_INVITE) {
if (resultCode == RESULT_OK) {
// Get the invitation IDs of all sent messages
String[] ids = AppInviteInvitation.getInvitationIds(resultCode, data);
for (String id : ids) {
Log.d(TAG, "onActivityResult: sent invitation " + id);
}
} else {
// Sending failed or it was canceled, show failure message to the user
// [START_EXCLUDE]
showMessage(getString(R.string.send_failed));
// [END_EXCLUDE]
}
}
}
// [END on_activity_result]
private void showMessage(String msg) {
ViewGroup container = findViewById(R.id.snackbar_layout);
Snackbar.make(container, msg, Snackbar.LENGTH_SHORT).show();
}