アラームを設定しようとしています。時間を cvs ファイルに保存しています。形式は hh:mm です (例: 02:13)。この時間にアラームを設定したい
次のコードを使用する
SimpleDateFormat dt = new SimpleDateFormat("hh:mm");
dt.parse(str); // GET TIME HERE
NotificationManager manger = (NotificationManager) this.getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.launcher, "Mosque Prayer Times", time);
PendingIntent contentIntent = PendingIntent.getActivity(this.getActivity(), 0, new Intent(this.getActivity(), AlarmReceiver.class), 0);
notification.setLatestEventInfo(this.getActivity(), name, title, contentIntent);
notification.flags = Notification.FLAG_INSISTENT;
notification.sound = Uri.parse("android.resource://com.trib.app.mosqueprayertimes/raw/adhan.mp3");
manger.notify(id, notification);
}
この日付形式から「時刻」を抽出して通知に設定する方法がわかりません