@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.news_content); String newsTitle = getIntent().getStringExtra("news_title"); String newsContent = getIntent().getStringExtra("news_content"); NewsContentFragment newsContentFragment = (NewsContentFragment) getSupportFragmentManager().findFragmentById(R.id.news_content_fragment); newsContentFragment.refresh(newsTitle, newsContent); }} NewsContentFragment newsContentFragment = (NewsContentFragment) getSupportFragmentManager().findFragmentById(R.id.news_content_fragment);这段代码显示
cannot cast 'android.support.v4.app.Fragment' to
'com.example.sweetstar.fragmentbestpractice.NewsContentFragment 错误
1 回答
- 1 回答
- 0 关注
- 1213 浏览
添加回答
举报
0/150
提交
取消