user1086494
user1086494

Reputation: 11

Launch Dropbox from my app Android

I want to call the dropbox app in my app Android using the Intent. What I have to do???

Thanks!!

Upvotes: 0

Views: 2883

Answers (2)

Mouna Cheikhna
Mouna Cheikhna

Reputation: 39658

If what you want is to share a file by lauching dropbox , you can use ACTION_SEND :

Intent intent = new Intent(Intent.ACTION_SEND);
startActivity(Intent.createChooser(intent, "title");

you can also send a specific file :

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType(fileType); 
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file.getPath()));  
startActivity(Intent.createChooser(intent, "title"));

See this article to understand the convention behind ACTION_SEND.

Upvotes: 2

Raghav Sood
Raghav Sood

Reputation: 82563

Try using PackageManager and getLaunchIntentForPackage() with the package name for DropBox, i.e com.dropbox.android. You will get a PackageManager.NameNotFoundException if Dropbox isn't installed.

Upvotes: 4

Related Questions