这篇文章主要围绕如何将应用程序的图像和HBITMAP传输到另一个应用程序?展开,旨在为您提供一份详细的参考资料。我们将全面介绍如何将应用程序的图像的优缺点,解答HBITMAP传输到另一个应用程序?的相
这篇文章主要围绕如何将应用程序的图像和HBITMAP传输到另一个应用程序?展开,旨在为您提供一份详细的参考资料。我们将全面介绍如何将应用程序的图像的优缺点,解答HBITMAP传输到另一个应用程序?的相关问题,同时也会为您带来android intent隐式调用之一个应用程序启动另一个应用程序、android – 从我们的应用程序打开另一个应用程序?、android – 如何在我的WebView应用程序中打开另一个应用程序?、android – 将数据从一个应用程序传递到另一个应用程序的实用方法。
本文目录一览:- 如何将应用程序的图像(HBITMAP)传输到另一个应用程序?(把图软件应用程序的操作)
- android intent隐式调用之一个应用程序启动另一个应用程序
- android – 从我们的应用程序打开另一个应用程序?
- android – 如何在我的WebView应用程序中打开另一个应用程序?
- android – 将数据从一个应用程序传递到另一个应用程序
如何将应用程序的图像(HBITMAP)传输到另一个应用程序?(把图软件应用程序的操作)
我尝试使用设备上下文传输图像数据,并处理位图,但在另一个应用程序中该句柄无效。 我需要将图像数据或DC数据从一个应用程序传输到另一个应用程序。 这可以如何实现?
如何检测多个USB端口和使用python从USB读取数据
Linux机器中的Windows Docker
使Powershellfunction/任务在后台运行
从webbrowser控件获取<DIV>标签
运行Python脚本作为Windows后台进程
在这里看起来像是重复的,为什么它们是无效的: 在不同的进程之间共享HDC
这里是对共享图像数据的技术的回应: 跨过程发送图像的最有效方式
android intent隐式调用之一个应用程序启动另一个应用程序
理解Intent的关键之一是理解清楚Intent的两种基本用法:一种是显式的Intent,即在构造Intent对象时就指定接收者,这种方式与普通的函数调用类似;另一种是隐式的Intent,即Intent的发送者在构造Intent对象时,并不知道也不关心接收者是谁,这种方式与函数调用差别比较大,有利于降低发送者和接收者之间的耦合。另外Intent除了发送外,还可用于广播.
显示调用 1.Intent intent = new Intent(); intent.setClass(A.this,B.class); //intent.setClassName("com.view","com.view.B");前者是A的包名,后者是B的代包类名
startActivity(Intent);
隐式调用:private static String MY_ACTION = "com.view.my_action";
Intent intent = new Intent(); intent.setAction(MY_ACTION);
或者// Intent intent = new Intent(MY_ACTION);
startActivity(Intent);
隐式调用注意不只是在AndroidManifest.xml文件中声明,还要加上intent-filter
在B类的activity中加上:
<intent-filter>
<action android:name="com.view.my_action"/> <!-- 自定义 -->
</intent-filter>
加上这句话就可以跳转到B类了
如果是想启动另外一个应用程序,如B类是在另外一个应用程序的入口,在其activity中再另外加上一个intent-filter
<activity android:name=".B" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="com.view.my_action"/>
<action android:name="android.intent.action.DEFAULT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
android – 从我们的应用程序打开另一个应用程序?
从我的应用程序,我必须打开另一个应用程序.是否有任何可能打开这样的?
解决方法:
您应该使用包管理器的功能.
try {
Intent i = ctx.getPackageManager().getLaunchIntentForPackage("com.android.browser");
ctx.startActivity(i);
} catch (NameNotFoundException e) {
// Todo Auto-generated catch block
}
android – 如何在我的WebView应用程序中打开另一个应用程序?
我有一个Android应用程序,它显示一个移动网站(WebView),在移动网站上有链接重定向到PDF,Excel和视频文件.
当我尝试在我的常规浏览器中打开它时,我的手机要求用另一个应用程序打开它或者它开始下载,所以我可以在之后打开它.
但是在我的WebView应用程序中,它既不起作用,也没有响应,或者显示“页面不可用”错误.
它甚至可能吗?
解决方法:
要在WebView中处理链接,可以使用WebViewClient类的shouldOverrideUrlLoading方法.考虑以下示例;
WebView webView = (WebView) findViewById(R.id.infoView);
webView.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// Assuming you are giving link to some PDF file.
if (url.contains(".pdf")) {
// Now do what you want to with the url here
}
return true;
}
}
这样,您可以拦截在WebView中点击的任何链接,然后执行您想要的任何操作.
android – 将数据从一个应用程序传递到另一个应用程序
参见英文答案 > launch activities from different package 4个
我有2个Android应用程序:
app1 - Activity11 --> Activity12 --> Activity13
app2 - Activity21 --> Activity22 --> Activity23
我想从一个应用程序传递到另一个应用程序的第二个活动,传递一些数据.
app1 - Activity11 -->(switch to app2)--> Activity22 --> Activity23
我要遵循哪些步骤?你知道一些教程吗?
我现在还没有编写代码,因为我不知道从哪里开始.
提前致谢.
解决方法:
你需要研究android Intents和Intent Filters. Check this training article for example.
This blog post can also be an interesting read.
发送文本的快速示例(其他类型位于顶部的链接中);
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(sendIntent);
并接受:
void onCreate (Bundle savedInstanceState) {
...
// Get intent, action and MIME type
Intent intent = getIntent();
String action = intent.getAction();
String type = intent.getType();
if (Intent.ACTION_SEND.equals(action) && type != null) {
if ("text/plain".equals(type)) {
handleSendText(intent); // Handle text being sent
} else if (type.startsWith("image/")) {
handleSendImage(intent); // Handle single image being sent
}
} else if (Intent.ACTION_SEND_MULTIPLE.equals(action) && type != null) {
if (type.startsWith("image/")) {
handleSendMultipleImages(intent); // Handle multiple images being sent
}
} else {
// Handle other intents, such as being started from the home screen
}
...
}
void handleSendText(Intent intent) {
String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
if (sharedText != null) {
// Update UI to reflect text being shared
}
}
void handleSendImage(Intent intent) {
Uri imageUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);
if (imageUri != null) {
// Update UI to reflect image being shared
}
}
void handleSendMultipleImages(Intent intent) {
ArrayList<Uri> imageUris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
if (imageUris != null) {
// Update UI to reflect multiple images being shared
}
}
您还必须更新清单:
<activity android:name=".ui.MyActivity" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
今天关于如何将应用程序的图像和HBITMAP传输到另一个应用程序?的分享就到这里,希望大家有所收获,若想了解更多关于android intent隐式调用之一个应用程序启动另一个应用程序、android – 从我们的应用程序打开另一个应用程序?、android – 如何在我的WebView应用程序中打开另一个应用程序?、android – 将数据从一个应用程序传递到另一个应用程序等相关知识,可以在本站进行查询。
本文标签: