インテントを使用して、アプリの Android でドロップボックス アプリを呼び出したいと思います。私がしなければならないこと???
ありがとう!!
PackageManager
およびをDropBoxgetLaunchIntentForPackage()
のパッケージ名 (つまりcom.dropbox.android
. Dropbox がインストールされていない場合は、PackageManager.NameNotFoundExceptionが発生します。
ドロップボックスを起動してファイルを共有したい場合は、ACTION_SENDを使用できます。
Intent intent = new Intent(Intent.ACTION_SEND);
startActivity(Intent.createChooser(intent, "title");
特定のファイルを送信することもできます:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType(fileType);
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file.getPath()));
startActivity(Intent.createChooser(intent, "title"));
ACTION_SENDの背後にある規則を理解するには、この記事を参照してください。