码迷,mamicode.com
首页 > 移动开发 > 详细

Android 第一行代码

时间:2015-07-01 22:08:54      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

日志文件如下:
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.onCreate 07-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;)V 07-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 {

.....
@Override
public 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方法。

Android 第一行代码

标签:

原文地址:http://www.cnblogs.com/laohu/p/4614614.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!