看板 AndroidDev 關於我們 聯絡資訊
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
ssccg: startActivity不是static method,要有instance才能呼叫 07/09 05:29
ssccg: a.startActivity 07/09 05:30
感謝 的確這樣後可以跑了 ※ 編輯: aynmeow (122.118.44.95), 07/09/2015 06:18:43