Dynamic IntentFilters

by Jonathan Herriott » Mon, 13 Apr 2009 21:49:10 GMT

Sponsored Links
 So, I have an instance where I want applications to be able to
dynamically specify what subset of data objects in my ContentProvider
they want to receive intents for.  The issue is that since it isn't
known at compile-time, I want them to be able to specify at runtime,
so I can query for the activities that implement the intent filter for
a specific data object and display that list.  I know Android allows
dynamically registering Receivers, so would it be possible to allow
dynamically registering Activities for specific IntentFilters in the
framework?  Is this too much of a security issue to allow?

Dynamic IntentFilters

by Dianne Hackborn » Mon, 13 Apr 2009 21:57:48 GMT

 Currently the contents of a manifest are static, and you can't change these
(even receivers) at runtime.  Receivers are a little bit of a special case
because you can dynamically register additional receivers while your app is
running -- but these only exist while your app is running, and are
completely independent of the receivers in the manifest (and work a little
differently from them, too).

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


Sponsored Links

Other Threads

1. User input in an AppWidget?


I've been looking at the new 1.5_pre SDK today, and the new AppWidget
API in particular. I was hoping to write a widget for posting to
Twitter as part of my nanoTweeter app. The interface I had in mind
would look very similar to the Google Search widget, with an EditText
and a submit Button, but as far as I can see there's no way to get at
user input in a RemoteViews. Is that right, or am I overlooking




2. Source not found.

Hi dev!
I'm a pretty new android dev.I want to create a contact using existing
android database.This is the code
package com.android.contact;

import android.app.Activity;
import android.content.ContentValues;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Contacts;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Contact extends Activity {

           private EditText name ;
           private EditText number ;
           private Button save ;

            /** Called when the activity is first created. */
            public void onCreate(Bundle icicle) {
                // ToDo add your GUI initialization code here
                name = (EditText) findViewById(R.id.name);
                number = (EditText) findViewById(R.id.number);
                save = (Button) findViewById(R.id.btnSave);

                //when save is clicked
               /* */save.setOnClickListener(new View.OnClickListener()
                            public void onClick(View v)
                                String nameId = name.getText().toString();
                                String phoneNumber = 
                             // create a new name
                                ContentValues values = new ContentValues();
                                //put value in database(key and value)
                                values.put(Contacts.People.NAME, nameId);
                                // add it to the database
(Contacts.People.CONTENT_URI, values);

But I have Source not found ERROR MESSAGE!
How could I do to solve this problem?
Thank you for all!



3. Change custom title view of window at run time

4. help compiling Android sourcecode apps

5. dynamically setting drawSelectorOnTop

6. How to debug android source code using eclipse?

7. ListView filtering with soft keyboard