Can we pass arguments pending intent for the background process.
Intent ij = new Intent(context,DemoActivity.class); PendingIntent operation = PendingIntent.getActivity(getBaseContext(),0,ij,Intent.FLAG_ACTIVITY_NEW_TASK); AlarmManager alarmManager = (AlarmManager) getBaseContext().getSystemService(ALARM_SERVICE); GregorianCalendar calendar = new GregorianCalendar(y, m, d,hr, mi); long alarm_time = calendar.getTimeInMillis(); alarmManager.set(AlarmManager.RTC_WAKEUP,alarm_time,operation);
In this, I use the alarm manager to start the background process. Using this method, can I pass any variables or arguments?
public class DemoActivity extends FragmentActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AlertDemo alert = new AlertDemo(); alert.show(getSupportFragmentManager(), "AlertDemo"); } }
And in the Alert Demo class, I just use the warning window. Now help me where to put the Put Exatra method? ..
source share