mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Better android input handling: sending notifications about CInputText changes to java so that we can display textinput overlay there; (#354)
This commit is contained in:
@@ -83,6 +83,16 @@ std::string CAndroidVMHelper::callStaticStringMethod(const std::string & cls, co
|
||||
return std::string(env->GetStringUTFChars(jres, nullptr));
|
||||
}
|
||||
|
||||
void CAndroidVMHelper::callCustomMethod(const std::string & cls, const std::string & method,
|
||||
const std::string & signature,
|
||||
std::function<void(JNIEnv *, jclass, jmethodID)> fun, bool classloaded)
|
||||
{
|
||||
auto env = get();
|
||||
auto javaHelper = findClass(cls, classloaded);
|
||||
auto methodId = env->GetStaticMethodID(javaHelper, method.c_str(), signature.c_str());
|
||||
fun(env, javaHelper, methodId);
|
||||
}
|
||||
|
||||
jclass CAndroidVMHelper::findClass(const std::string & name, bool classloaded)
|
||||
{
|
||||
if(classloaded)
|
||||
|
||||
Reference in New Issue
Block a user