If I understood your question correctly, you wanted to set the text in the TextView from c code, right?
If so, you can do it. You need to pass TextViewas a parameter to your own method. Then, in your native code call, find its method setTextand call it.
SO .
- :
jstring Java_com_example_encryptString( JNIEnv* env, jobject thiz, jobject jtextViewObject, ...)
{
//getting set text method
jclass clazz = (*env)->FindClass(env, "android/widget/TextView");
jmethodID setText = (*env)->GetMethodID(env, clazz, "setText", "(Ljava/lang/CharSequence;)V");
... do stuff ...
//set text to text view
jstring jstr = (*env)->NewStringUTF(env, "This comes from jni.");
(*env)->CallVoidMethod(env, jtextViewObject, setText, jstr);
... do stuff ...
return (*env)->NewStringUTF(env, "only from return!");
}
java-, TextView params.