Yes, there's bug. thanks you.
I using GetStringUTFChars 

function JNI_JStringToString(Env: PJNIEnv; JStr: jstring): String;
var
  IsCopy: Pjboolean;
  Chars: PChar;
begin
  if JStr = nil then
  begin
    Result := '';
    Exit;
  end;

  Chars:= Env^.GetStringUTFChars(Env, JStr, IsCopy);
  if Chars = nil then
     Result := ''
  else
    Begin
      Result := String(Chars);
      Env^.ReleaseStringUTFChars(Env, JStr, Chars);
    end;
end; 

-----
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/android-JNI-JString-to-String-tp4340388p4342883.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to