我们可以在后台进程的未决意图中传递参数吗?
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);
在此,我使用警报管理器来启动后台进程。通过使用这种方法,我可以传递任何变量或参数吗?
public class DemoActivity extends FragmentActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/** Creating an Alert Dialog Window */
AlertDemo alert = new AlertDemo();
/** Opening the Alert Dialog Window */
alert.show(getSupportFragmentManager(), "AlertDemo");
}
}
在警报演示类中,我只使用一个警报框..现在帮助我,在哪里放置 Put Exatra 方法?..