Some questions about intents and Notepad example

by david » Fri, 09 May 2008 14:19:57 GMT


Sponsored Links
 Since Notepad example is the first classic sample provided by Google,
I think it is worth to study it in close detail.

1. Is it possible for an intent receiver receiving multiple eligible
intents at the same time? If so, what are the priorities associated
with those intents?
Is it possible for an activity receiving multiple eligible intents at
the same time? If so, what are the priorities associated with those
intents?

2. Refer to NotePad/NoteEditor.java/onCreateOptionsMenu() comments. Do
we really need to query system for all activities that implement
ALTERNATIVE_ACTION on the data, and add a menu item for each one that
is found?

3. Where in the code showing the title-editor activity pop-ups a
floated window?

4. In com.google.provider/NotePad.java:

    public static final class Notes implements BaseColumns {
        /**
         * The content:// style URL for this table
         */
        public static final Uri CONTENT_URI
                = Uri.parse("content://com.google.provider.NotePad/
notes");

   where is the "notes" used? What is the purpose of this NotePad.java
file?
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Problem with ACTION_SEARCH Intent on Nexus since update to 2.2 ?

Before updating to 2.2 on a Nexus the following code was doing what I
expected - giving the user a choice of activities to search in for the
query term. Since updating from 2.1 to 2.2  the same code on the Nexus
launches and starts a search on Android Market directly.

Weirdly, on the emulator running 2.2. this same code performs as
expected and launches a chooser for the user to pick which activity to
search in.

Something wrong with my code, a bug in the update, or something else?

Can anyone suggest a work around - I want the user to be able to chose
which activity/application to run the search in (e.g. gmail, you tube,
sms clients, etc).

Intent searchIntent = new Intent();
searchIntent.setAction(Intent.ACTION_SEARCH);
searchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
searchIntent.putExtra(SearchManager.QUERY,
mItemName.getText().toString());
Toast.makeText(this, "Finding searchable applications",
Toast.LENGTH_SHORT).show();
startActivity(Intent.createChooser(searchIntent, "Search in:"));

Thanks

-- 

2. Bluetooth PBAP

Hi guys! I'm gonna try to introduce briefly what I'm working on, and
then present my question... any help will be very much appreciated!

I've been trying to connect an Android device to other phones in order
to import their phonebook info over bluetooth, using the phonebook
access profile. To achieve that, I'm trying to place my device as PCE,
while the other phone will act as the PSE.

I know that the PSE role is already implemented on Android, so I'm
looking into its code and trying to somehow reverse engineer it to
implement the other side.

So.. my problem is: when the server socket is created, it doesn't
specify any UUID, it simply starts listening on a port 19, like this:

mServerSocket = mAdapter.listenUsingRfcommOn(PORT_NUM);

Wasn't it supposed to register the PBAP service somewhere? How does
other devices discover the service, and more important, which UUID
should I use when trying to connect in my PCE device with:

mSocket = mDevice.createRfcommSocketToServiceRecord(UUID_PBAP);


Thanks, Pedro.

-- 

3. Use of Service component?

4. ViewFlipper Help Please

5. Sensors with thread or not?

6. R: Use of Service class

7. What is meaning of context?