尝试从Firestore检索数据到回收站视图

时间:2020-07-12 11:59:58

标签: java android firebase google-cloud-firestore

        sitekey = site["src"].split("=")[-1]
        
        currenturl = driver.current_url
        print (currenturl)


        flag, captcha = solve_h_captcha(sitekey,currenturl)

        username = driver.find_element_by_name('g-recaptcha-response')
        username.send_keys(captcha)
        time.sleep(2)
        
        username = driver.find_element_by_name('h-captcha-response')
        username.send_keys(captcha)
        time.sleep(2)

#        username.send_keys(captcha)
        time.sleep(0.5)

模型类{

  XML
 android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">

<TextView
    android:id="@+id/texttype"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="TextView"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.118"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.132" />

<TextView
    android:id="@+id/textfats"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="TextView"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.6"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

<TextView
    android:id="@+id/texttype"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="TextView"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.118"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.132" />

<TextView
    android:id="@+id/textfats"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="TextView"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.6"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

}

'

公共类产品扩展了AppCompatActivity {

private String Type;
private String Fats;

public productsmodel(){}

public productsmodel(String Type, String Fats){
    this.Type = Type;
    this.Fats=Fats;
}


public String getType() {
    return Type;
}

public void setType(String type) {
    Type = type;
}

public String getFats() {
    return Fats;
}

public void setFats(String fats) {
    Fats = fats;
}

}`

1 个答案:

答案 0 :(得分:0)

只需添加

FirebaseFirestore firebase = FirebaseFirestore.getInstance()

在使用Firebase之前,在onCreate方法中。