解决方案 »

  1.   

    你把 xml 文件贴出来 看看
      

  2.   

    应该是 xml 文件中 TextView tv=(TextView)findViewById(R.id.textView1); 定义错了 找重看下 id 是不是 @+id
      

  3.   


    res/layout下的blogdetail.xml代码如下:<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >    <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Large Text"
            android:textAppearance="?android:attr/textAppearanceLarge" />    <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Button" /></LinearLayout>
      

  4.   

    import android.R;应该是r文件导错了。
      

  5.   

    楼上正解,  你应该导入工程的 R 文件 import cn.myapp.R 你导入的是 import android.R; 导错了, 删掉 import android.R; 重新导入一下
      

  6.   

    改为:import com.example.helloworld.R;
    run时仍然报错有错,没有地方报划红线打叉那种了,不知道改哪
      

  7.   

    重搞了一下activity终于可以了,结贴