解决方案 »

  1.   

    Intent intent = new Intent(MainActivity, OtherActivity.class);
    =>
    Intent intent = new Intent(getActivity(), OtherActivity.class);
      

  2.   

      Intent intent = new Intent(MainActivity, OtherActivity.class); 
    试试
      Intent intent = new Intent(MainActivity.this, OtherActivity.class); 
      

  3.   

    支持楼上,报错时多注意报错信息,看看new Intent构造器里应该传入的是什么参数
      

  4.   

    改成Intent intent = new Intent(MainActivity.this, OtherActivity.class);  试试