[英]How do i use getIntent().getSerializableExtra to retrieve data from the database
我將數據從一個活動傳遞到另一個活動,並發現這種方式可以從我的 Shop class 中檢索我的 get 方法。
現在我不知道如何繼續將這些數據插入到我的 DetailsActivity 中的 TextViews 或 ImageViews 中。
我將如何 go 這樣做?
到目前為止,這是我的代碼:
public class DetailsActivity extends AppCompatActivity {
private FirebaseFirestore firebaseFirestore;
private RecyclerView FirestoreList;
private FirestoreRecyclerAdapter adapter;
TextView name_details;
TextView address_details;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_details);
Shop shopModel = (Shop) getIntent().getSerializableExtra("shopModel");
name_details = findViewById(R.id.details_shopName);
address_details = findViewById(R.id.detail_addressDetails);
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.