0

What i would like is when i select a date it filters the rss feed to display the roadworks on the day that is selected. Only for now i start an intent to take me to the next activity which displays all the roadworks and not the ones on the day selected. How would i go about this?

public class ChooseDate extends Activity {

    RelativeLayout rl;
    Button pick;
    DatePicker date;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.date_picker);

        rl = (RelativeLayout) findViewById(R.id.rl);
        pick = (Button) findViewById(R.id.button1);

        date = new DatePicker (ChooseDate.this);

        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams 
                ((int) LayoutParams.WRAP_CONTENT, (int) LayoutParams.WRAP_CONTENT);
        params.addRule(RelativeLayout.CENTER_IN_PARENT);

        date.setLayoutParams(params);

        rl.addView(date);

        pick.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub

            Toast.makeText(getBaseContext(), "Date is : " +
                date.getDayOfMonth() + "-"+(date.getMonth()+1) + 
                "-"+ date.getYear(), Toast.LENGTH_SHORT).show();
            startActivity(new Intent("com.mobilerwts.robert.MainActivityOther"));
        }
    });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
}
PearsonArtPhoto
  • 38,970
  • 17
  • 111
  • 142

1 Answers1

1

If I understand this right, you want to pass the date from the first activity to the second. If you are going to do that, you need to include it in the Intent. Basically, you have to include the data in the intent. See How do I pass data between Activities in Android application? for how to do that.

Community
  • 1
  • 1
PearsonArtPhoto
  • 38,970
  • 17
  • 111
  • 142