猿问

有关android的问题,求解答


   @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   错误

给我一颗糖哩3477424
浏览 1215回答 1
1回答
随时随地看视频慕课网APP

相关分类

Android
我要回答