intent.action_send and intent chooser

by tnull » Tue, 20 Jul 2010 22:20:44 GMT


Sponsored Links
 When creating an intent with action send to send some data, is there a
way to filter the results that are included in the activity chooser
that is created using Intent.createChooser? I have not seen a way to
do this other than setting the mime type, but it is not flexible
enough.

For example, there is a situation when I want e-mail apps to be the
only results in the activity chooser dialog. Setting the type to "text/
html" successfully filters this down to email apps, except when
bluetooth is enabled. Bluetooth appears in the list as well, but this
is not desirable. Surely there is a way to have a little more control
over the results?

--



intent.action_send and intent chooser

by Mark Murphy » Tue, 20 Jul 2010 22:31:06 GMT


 


What are "e-mail apps"?


Only on your test environment(s). Anyone can create an application
that supports ACTION_SEND of text/html -- this it not something
exclusive to "e-mail apps". I would not be the least bit surprised if
there are others on certain devices or out on the Market.


Write your own chooser dialog, using PackageManager.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

--


Sponsored Links


intent.action_send and intent chooser

by tnull » Tue, 20 Jul 2010 23:39:13 GMT


 With e-mail apps, I just meant I was looking to filter the results to
e-mail clients, not necessarily anything that can handle "text/html",
which I realized wouldn't work when bluetooth popped up.

Thank you for the tip on creating my own dialog using PackageManager,
I will look into that.







--



Other Threads

1. CDMA home carrier

How does one determine the home carrier on a CDMA phone? By home
carrier I mean the carrier that the phone's owner has a contract with,
not the owner of the cell site that the phone is communicating with.
These are different when the phone is roaming. On a GSM phone I can
get the home carrier from the IMSI recorded on the SIM, but this does
not work on a CDMA phone. CDMA has a similar identifier called home
system ID. Is there a way to query the home system ID? If that is not
possible, how do I determine the home carrier? On Windows Mobile I am
forced to search the registry looking for strings like 'Verizon' and
'Sprint'. Is there a similar klooge on Android?

-- 

2. Memory usage problem - leak?

Hello,

In my app, I'm fetching data via HTTP and use the response string to create
an ArrayList of objects. So what I'm doing once I get the response is:

String[] fields = response.split("<field>");

and use the field[] values like this:

ArrayList<Movie> movies = new ArrayList<Movie>();
for (int row = 1; row < fields.length; row += 9) {
   movies.add(new Movie(fields[row], fields[row + 1], ..., fields[row + 8]);
}

Now, when I load the heap dump of the app into Eclipse's Memory Analyzer
Tool[1], the response string still shows up (about 800KB - 28%), as well as
the ArrayList (245KB - 8.7%). I suppose the size of the ArrayList is about
right, since some of the field values are stored as integers and there is no
overhead of the <field></field> tags.

But I don't understand why the response string is still living. I've tried
setting response = null after creating the array, but it still shows up.
Shouldn't it be GCed? Then when I go back to my home activity, leaving the
activity that fetched the data and kept the ArrayList in its adapter, both
objects *still* show up. Does that mean there is a leak somewhere? Android
is supposed to destroy a closed activity and its references (if not
referenced elsewhere), right?

I've read Romain's blog entry about memory leaks and some more other blog
entries like this[2] and this[3] one but I still can't figure this out. My
real code can be found here[4].

Suggestions and hints appreciated!


[1]
http://kohlerm.blogspot.com/2009/04/analyzing-memory-usage-off-your-android.html
[2] http://java.dzone.com/news/how-fix-memory-leaks-java
[3] http://kohlerm.blogspot.com/2009/02/memory-leaks-are-easy-to-find.html
[4]
http://code.google.com/p/android-xbmcremote/source/browse/trunk/XBMC%20Remote/src/org/xbmc/httpapi/client/VideoClient.java#221

-- 

3. Privacy concerns using Android NETWORK_PROVIDER?

4. Saving service killing without "startForeground"

5. Capture key events while in background

6. Modify voice data before it's sent

7. Listview inside ScrollView doesn't expand