简体   繁体   English

如何从我的应用程序启动picasa(android)

[英]how to launch picasa from my app(android)

i have a picasa app installed on my emulator,i just want to launch that picasa app from my application... 我在模拟器上安装了picasa应用,我只想从我的应用中启动该picasa应用...

please any one give the code to launch picasa.. 请任何人提供启动Picasa的代码。

This is more less or less the snippet to share your stuff with other apps except that you specify a specific Component for Picasa. 除了您为Picasa指定了特定的组件外,这几乎是与其他应用共享内容的代码段。 Try this once on a device. 在设备上尝试一次。 Am not sure how it works on emulator. 不知道它如何在模拟器上工作。

final int PICASA_INTENT_RESULT = 100;

final Intent picasaIntent = new Intent(Intent.ACTION_SEND); 
picasaIntent.setType("image/*"); 
picasaIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); 
picasaIntent.putExtra(Intent.EXTRA_STREAM, imageUri); 
picasaIntent.setComponent(new ComponentName("com.google.android.apps.uploader", "com.google.android.apps.uploader.picasa.PicasaUploadActivity")); 
startActivityForResult(picasaIntent, PICASA_INTENT_RESULT);

You need to know the package name of Picasa. 您需要知道Picasa的软件包名称

Here is a example to launch the browser in Android: 这是在Android中启动浏览器的示例:

public void doLaunch(View caller) {
    PackageManager packageManager = getPackageManager();
    startActivity(packageManager.getLaunchIntentForPackage("com.android.browser"));
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM