从RecyclerView将项目添加到arraylist

时间:2018-08-19 14:45:36

标签: android firebase firebase-realtime-database android-recyclerview

我有一个RecyclerView,当我在RecyclerView中单击一个值时,我希望将其添加到一个数组列表中,单击完成后该列表将发送到Firebase。请注意,我需要能够选择多个值,并且所有值都必须添加到同一列表中。我的值在listItem.getEmail中,但是如何将其获取到数组中,然后添加更多值?

这就是我得到的:

Adapter.java

/* ... */
foreach ($authors as $author) {
  $result.='<option value="'.$author["column_name"].'">' .$author["column_name"].'</option>';
}
/* ... */

SetProject.java

.wpcf7-text, .wpcf7-textarea, .wpcf7-captchar, .wpcf7-form-control-wrap {
background-color:rgba(255, 255, 255) !important;
border: none !important;
width: 100% !important;
border-radius: 0 !important;
font-size: 16px;
font-weight: 500;
color: #1c1c1c !important;
padding: 16px !important;
box-sizing: border-box;
}
.wpcf7-submit {
color: #fff;
background-color: #414141 !important;
margin: 8px auto 0;
font-family: Francois One, latin;
font-size: 30px;
font-weight: 500;
border-color: #414141 !important;
border-bottom: 3px solid rgb(163, 163, 163)!important;
border-left: #414141 !important;
border-right: #414141 !important;
border-radius: 8px;
padding: 6px 60px;
line-height: 1.7em;
box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.4);
}
.wpcf7-submit:hover { 
background-color:rgba(78, 78, 78) !important; 
border-width: 2px !important;
border-color:  #494949 !important;
border-bottom: 3px solid rgb(163, 163, 163)!important;
border-left: #4e4e4e !important;
border-right: #4e4e4e !important;
border-radius: 8px;
padding: 6px 0px !important;

}
span.wpcf7-list-item { display: block; }

我希望您了解我在寻找什么,希望对您有所帮助。谢谢!

1 个答案:

答案 0 :(得分:0)

source ~/.bash_profile

然后将此列表发送到firebase数据库。