我的其他活动没有扩展YouTubeBaseActivity。我可以使用setLifecycleOwner 我希望我的Listview和Youtube视频处于同一活动中。 活动扩展YouTubeBaseActivity时如何设置LifecycleOwner?
Query query=post.orderByChild("fbmail").equalTo(Mail);
FirebaseListOptions<Adoption> options =new FirebaseListOptions.Builder<Adoption>()
.setLayout(R.layout.adoptionlist)
.setQuery(query,Adoption.class)
.setLifecycleOwner(ClickPersonPageActivity.this)//can't use
.build();
adapter=new FirebaseListAdapter(options) {
@Override
protected void populateView(View v, Object model, int position) {
TextView Name=v.findViewById(R.id.accountTextview);
TextView Title=v.findViewById(R.id.titleTextview);
TextView content=v.findViewById(R.id.contentTextview);
ImageView Picture=v.findViewById(R.id.photoImageview);
Adoption a=(Adoption) model;
Name.setText(a.getName().toString());
Title.setText(a.getTitle().toString());
content.setText(a.getcontent().toString());
Glide.with(ClickPersonPageActivity.this)
.load(a.getPicture())
.into(Picture);
}
};
commentLV.setAdapter(adapter);