Hi
I'm trying to make a 'share' option in menu, just like in the gallery
application.
I am using the following code:
MenuItem item2 = menu.add(0,0,0, "Share");
item2.setOnMenuItemClickListener(new
MenuItem.OnMenuItemClickListener() {
public boolean onMenuItemClick(MenuItem item) {
Intent intent = new Intent(Intent.ACTION_SEND, null);
File f = new File
(Environment.getExternalStorageDirectory()+"/Ania.jpg");
intent.setData(Uri.fromFile(f));
startActivity(Intent.createChooser(intent,"Share a
picture or sth"));
return true;
}
});
When i press the Share button in the menu i get "No applications can
perform this action".
What am I doing wrong? (im working on a real device not the
emulator).
regards
Lukas Mosdorf
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---