日志文件如下:
07
-01 13:21:36.265 17086-17086/stuapplication.pla.edu.cn.fragmentbestpractice W/dalvikvm﹕ VFY: unable to find class referenced in signature (Landroid/os/PersistableBundle;)07-01 13:21:36.265 17086-17086/stuapplication.pla.edu.cn.fragmentbestpractice I/dalvikvm﹕ Could not find method android.support.v7.app.AppCompatActivity.onCreate, referenced from method stuapplication.pla.edu.cn.fragmentbestpractice.NewsContentActivity.onCreate07-01 13:21:36.265 17086-17086/stuapplication.pla.edu.cn.fragmentbestpractice W/dalvikvm﹕ VFY: unable to resolve virtual method 9140: Landroid/support/v7/app/AppCompatActivity;.onCreate (Landroid/os/Bundle;Landroid/os/PersistableBundle;)V07-01 13:21:36.265 17086-17086/stuapplication.pla.edu.cn.fragmentbestpractice D/dalvikvm﹕ VFY: replacing opcode 0x6f at 0x0000
                     
相关代码:

public class NewsTitleFragment extends Fragment implements AdapterView.OnItemClickListener {

.....
@Overridepublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {    News news = (News) newsArrayList.get(position);    if (isTwoPageModel){        Log.v("NewsTitleFragment","Sorry, pad screen adapter not complete");    }else {        NewsContentActivity .actionStart(getActivity(), news.getTitle(), news.getContent());    }}.....}
public class NewsContentActivity extends AppCompatActivity {    public  static  void actionStart(Context context, String title, String content){        Intent intent = new Intent(context,NewsContentActivity.class);        intent.putExtra("title", title);        intent.putExtra("content", content);        context.startActivity(intent);        Log.v("NewsContentActivity", "startActivity");    }
....
}

最终执行时,程序没有执行NewsContentActivity的onCreate方法。

在重写onCreate方法时选择了

import android.app.Activity;

包中的

@Overridepublic void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {    super.onCreate(savedInstanceState, persistentState);}

方法,导致了日志中的:

Could not find method android.support.v7.app.AppCompatActivity.onCreate
情况。

                                                                                            

更多相关文章

  1. 转:android 图片叠加效果——两种方法
  2. Android Studio 下无法调用org.apache。。类的解决方法
  3. 重写Android Log的输出,只在debug的时候输出,release 的版本不输出
  4. 去掉ListView底部的ListDivider的方法
  5. Android的Service中弹出窗口解决方法
  6. Android使用线程获取网络图片的方法
  7. Android AndroidManifest.xml 四大组件注册方法
  8. Android中onClick的四种实现方法
  9. android中获取IP的方法

随机推荐

  1. Android(安卓)ApiDemos示例解析(102):Vie
  2. unity实现android虚拟现实应用
  3. Android 应用程序开关GPS
  4. 【转】android开源项目---项目篇
  5. Android Intent study
  6. 高手速成android开源项目【developer篇】
  7. Android Handler的使用
  8. [置顶] 我的Android进阶之旅------>Ubunt
  9. cocos2d-x调用android内嵌浏览器打开网页
  10. Android(安卓)积累