[問題] 獨立出一個method來切換activity
public class Core_ChangeActController {
public static void Core_ChangeActController(Activity a,
Class b ,
boolean c )
{
Intent intent = new Intent();
intent.setClass(a, b);
這行出錯>> Context.startActivity(intent);
a.finish();
}
}
Cannot make a static reference to the non-static method startActivity(Intent)
from the type Context
錯誤提示是這樣...
不是很懂 ><
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 122.118.44.95
※ 文章網址: https://www.ptt.cc/bbs/AndroidDev/M.1436389769.A.937.html
→
07/09 05:29, , 1F
07/09 05:29, 1F
→
07/09 05:30, , 2F
07/09 05:30, 2F
感謝 的確這樣後可以跑了
※ 編輯: aynmeow (122.118.44.95), 07/09/2015 06:18:43