Declaring Intent Filter in android

Posted by Rahul Varma on Stack Overflow See other posts from Stack Overflow or by Rahul Varma
Published on 2010-04-08T06:31:49Z Indexed on 2010/04/08 6:33 UTC
Read the original article Hit count: 347

Filed under:

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

© Stack Overflow or respective owner

Related posts about android-sdk