次のコードを使用して、設計された時間の後に新しいインテントを呼び出すブロードキャストレシーバーを開始しましたが、問題はインテントが呼び出されていないことです。アラームは画面上のボタンによって呼び出され、指定された時間の後にボタンがクリックされると、新しいインテントが開始されることが期待されます。
private void alarm(){
br = new BroadcastReceiver() {
@Override
public void onReceive(Context c, Intent i) {
Toast.makeText(c, "Rise and Shine!", Toast.LENGTH_LONG).show();
}
};
Log.v("ranjith","Inside setup");
registerReceiver(br, new IntentFilter("com.example.ads.test"));
pendingIntent = PendingIntent.getBroadcast( this, 0, new Intent(getApplicationContext(),test.class),0);
alarmManager = (AlarmManager)(this.getSystemService( Context.ALARM_SERVICE ));
}