你是报错还是没反应?报错的话估计是没注册activity或者包名类名写错了
没反应的话,你在onclick里头写个输出看看到底click执行没有而且一般都是这样写比较不会出错
intent.setClassName(DemoControlActivity.this.getPackageName(), act2.class.getName());

解决方案 »

  1.   

    有没有给textview控件 添加单击事件属性哦?你最好贴出运行结果来
      

  2.   

    是在同一个package内吗?不是你这样就不行的,
    最好的方式是 new Component(TartPackage, TargetClassName);
      

  3.   

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
    // TODO Auto-generated method stub
    switch(item.getItemId()){
    case Menu.FIRST + 1:
    ComponentName componentname = new ComponentName(WolifeActivity.this, "com.sxit.login.LoginActivity");
    Intent intent = new Intent();
    intent.setComponent(componentname);
    startActivity(intent);
    break;
    case Menu.FIRST + 2:
    break;
    case Menu.FIRST + 3:
    break;
    }
    return super.onOptionsItemSelected(item);
    }没反应。WolifeActivity 在com.sxit.wolife包下,LoginActivity在com.sxit.Login包下。
      

  4.   

    1.如果你目的activity在manefest中定义了action,就直接用action启动,
      Intent i = new Intent(); 
      i.setAction(action);
      StartActivity(i);
    2.如果没有定义。
      Intent i = new Intent();
      i.setComponentName(new ComponentName(activity's packagename, activity's classname));
      StartActivity(i);
      

  5.   

    在xml里面写  android:clickable="true",不然不能点击
      

  6.   


                    <TextView
                        android:id="@+id/textViewForgetPassword"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/forgetpassword"
                        android:clickable="true"
                        android:focusable="true" />                <TextView
                        android:id="@+id/textViewRegister"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/speedregister"
                        android:clickable="true"
                        android:focusable="true" />
    我加了啊?还是不行,点击它没反应。
      

  7.   

    没必要加这个,你还是启动activity的问题
      

  8.   


    试了,还是运行点击跳转钮,跳转Activity出错。
      

  9.   

    解决了,不同包间activity跳转需要全包路径。