protected void onCreate(Bundle paramBundle) {
super.onCreate(paramBundle);
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
this.setContentView(R.layout.testaaa);
Intent intent = this.getIntent();
titleText = (TextView) findViewById(R.id.TitleText);
titleText.setText("活动明细");  这行报空指针去掉就问题。实在找不到原因了
userName = intent.getStringExtra("userName");

解决方案 »

  1.   

    titleText = (TextView) this.findViewById(R.id.TitleText);
      

  2.   

    titleText 是null,布局里可能没有这个
      

  3.   

    去看下testaaa.xml里是不是有TitleText。
      

  4.   

    你这里没有加入布局啊  setContentView(R.layout.main);
      

  5.   

    查看下布局文件,是否有TitleText
      

  6.   

    有时候这类问题你可以试着把Eclipse重启一下,或编译一下工程再试试。
      

  7.   

    确定R.id.TitleText在R.layout.testaaa布局中
      

  8.   

    肯定是R文件中没有编译到这个id。