1
中調用,正如它在標題中所述。我試圖從守護線程上的定時器發送一個意圖,該守護線程將被另一個應用程序接收。我可以這樣做還是需要在活動中調用?sendBroadcast(Intent i)是否需要從活動
還有什麼方法可以找出什麼類需要擴展或實現,而不試圖找到某人使用它的例子。
我使用的是從班裏run()
功能擴展TimerTask
// send info
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra("MyClass", playing);
intent.setType("*/*");
sendBroadcast(intent);