Declaring Intent Filter in android
- by Rahul Varma
Hi,
I have problem in declaring the intents on my app. I have a form with text fields and spinner. I have added a button which onClick must display Datepicker. I have declared the DatePicker as a new class and added to intent onCLick.
date.setOnClickListener(new View.OnClickListener() {
public void onClick(View view)
{
Intent i=new Intent(SendMail.this,DatePicker.class);
startActivity(i);
}
});
In manifest i have declared
<activity android:name=".DatePicker">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Now the problem is when i click the button the whole form is getting reset and all the spinner values are getting vanished. This must be because of declaring the intent wrongly. So, can anyone specify how to declare my intent so that the DatePicker will be called on the main form iteself