Solution 1 :
Simply use setText
method with your TextView
name_details.setText(shopModel.yourNameValue());
address_details.setText(shopModel.yourAddressValue());
With ImageView
is a little bit complicate if your image is from Internet. You need a image downloading library like Picasso or Glide
or if your image is from res/drawable
, you just need to
imageView.setImageResource(shopModel.yourImageResId());
Problem :
i passed data from one activity to another and found this way to retrieve my get methods from my Shop class.
now i do not know how to proceed to insert these data into the TextViews or ImageViews in my DetailsActivity.
how would i go about doing this?
this is my code so far:
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);
}
}