방송 수신자가 있고 그 수신자의 방법으로 다시 방송 메시지를 보내고 있습니다.정적 방송에 오류가 발생했습니다
public static class MyBroadcastReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
// TODO Auto-generated method stub
Intent intent1 = new Intent("com.test.test");
sendBroadcast(intent1);
}
}
하지만 sendBroadcast
에 오류가 있습니다cannot make a static reference to the non-static method sendbroadcast(intent)
from the type context wrapper.
날이 문제를 해결 도와주세요.
의 구현을 위해 다음 링크를 참조해야하지만 상황이 sendbrodcast 전에 필요한 이유를 말해 answer.can 수있는 권리를 제공합니다.?. sendBroadcast는 어떤 클래스에 속합니까? –
@wqrahd : [ContextWrapper] (http://developer.android.com/reference/android/content/ContextWrapper.html) 클래스 –
클래스가 정적 인 경우 컨텍스트가 필요한 이유는 무엇입니까? –