我想從一個新的線程發送廣播是開始。發送來自可運行的廣播意圖
這是我的嘗試:
new Thread(new Runnable() {
public void run() {
//some other code for timing.
// ..
// ..
Intent broadcastIntent = new Intent();
broadcastIntent.setAction(Intent.ACTION_ANSWER);
this.sendBroadcast(broadcastIntent);
}
}).start();
但ofcourse我需要context..this將無法正常工作。 我該如何處理這個問題。
不是一個好主意。 – natario 2015-12-23 11:52:25
很多錯誤的好主意。 – 2016-04-27 10:44:28
靜態活動是內存泄漏的一個步驟。永遠不要這樣做。 – Gark 2016-08-17 08:19:52