| | |
| | | package safeluck.drive.evaluation.fragment; |
| | | |
| | | import android.app.AlarmManager; |
| | | import android.app.PendingIntent; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.core.app.AlarmManagerCompat; |
| | | import androidx.lifecycle.Observer; |
| | | import androidx.lifecycle.ViewModelProviders; |
| | | import androidx.work.OneTimeWorkRequest; |
| | |
| | | |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | | import android.os.SystemClock; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | |
| | | public class TrainFragment extends SupportFragment implements View.OnClickListener { |
| | | |
| | | private static final String TAG = TrainFragment.class.getSimpleName(); |
| | | private static final int REQUEST_CODE = 1000; |
| | | private static final String ALARM_ACTION_CODE = "com.anyun.alermbroadcast"; |
| | | |
| | | public static SupportFragment newInstance() { |
| | | return new TrainFragment(); |
| | |
| | | |
| | | private void initView(View view) { |
| | | |
| | | Intent intent = new Intent(ALARM_ACTION_CODE); |
| | | PendingIntent pendingIntent = PendingIntent.getBroadcast(_mActivity.getApplicationContext(), |
| | | REQUEST_CODE, intent, |
| | | PendingIntent.FLAG_CANCEL_CURRENT); |
| | | AlarmManager alarmManager = (AlarmManager) _mActivity.getApplicationContext().getSystemService(Context.ALARM_SERVICE); |
| | | alarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime(),pendingIntent); |
| | | |
| | | |
| | | view.findViewById(R.id.iv_head).setOnClickListener(this); |
| | | av_curve = view.findViewById(R.id.av3); |
| | | av_park = view.findViewById(R.id.av2); |