Android的:如何播放从本地code意图是什么? [英] Android: How to broadcast intent from native code?
本文介绍了Android的:如何播放从本地code意图是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以播放从本地code的意图是什么?如果是这样,有文件和/或样品code就相关的API?
Is it possible to broadcast an Intent from native code? If so, is there documentation and/or sample code pertaining to the relevant APIs?
推荐答案
您将需要通过调用Java API函数来调用它 - 没有JNI接口的意图
You will need to call it by calling the Java API function - there is no JNI interface for intents.
首先查找类意图
,然后查找方法构造意图和广播他们,给他们打电话。
First look up the class for Intent
, then look up the methods for constructing intents and broadcasting them, and call them.
编辑:这是一个的不完整的的例子。 的JNIEnv
传递到所有的JNI功能。
Here is an incomplete example. jniEnv
is passed into all your JNI functions.
jclass activityClass = jniEnv->FindClass("android/app/Activity");
jmethodID startAcitivtyMethod = jniEnv->GetMethodID(activityClass , "startActivity", "(Landroid/content/Intent;)V");
jniEnv->CallVoidMethod(yourActivityObject, startAcitivityMethod, yourIntentObject);
这篇关于Android的:如何播放从本地code意图是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文