0
내 수신기가 발사되지 발사하지 코드 :브로드 캐스트 리시버,
AndroidManifest를
<recevier android:name=".NoticeReceiver" android:enabled="true">
<intent-filter>
<action android:name="com.clublifestyle.NoticeService.BROADCAST" />
</intent-filter>
</recevier>
NoticeReceiver.java
public class NoticeReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "ASDASD", Toast.LENGTH_SHORT).show();
}
}
CLMainActivity.java
public class CLMainActivity extends TabActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.main);
this.createTabs();
Intent i2 = new Intent(this, NoticeReceiver.class);
this.sendBroadcast(i2);
}
}
당신이 도와 드릴까요 내가 왜 그런지 알아봐? 감사합니다.
을 보았지만 여전히 작동하지 않습니다. –
@kenyi 문제의 원인을 발견했습니다. 매니 페스트에서 올바른 단어는'receiver'이며,'recevier'라고 쓴 것이 아닙니다. 이제 앱은 단순히 수신기를 보지 못합니다. – Luksprog
큰 감사합니다! Eclipse가이 오타에서 오류를 감지하지 못하는 것처럼 보입니다. –