Implement link helper for android

This commit is contained in:
Benau
2019-10-28 16:47:05 +08:00
parent aa647cce67
commit ab3d8ef415
4 changed files with 82 additions and 5 deletions

View File

@@ -4,7 +4,9 @@ import org.supertuxkart.stk_dbg.STKEditText;
import android.app.NativeActivity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
@@ -181,6 +183,14 @@ public class SuperTuxKartActivity extends NativeActivity
}
// ------------------------------------------------------------------------
/* Called by STK in JNI. */
public void openURL(final String url)
{
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
// ------------------------------------------------------------------------
/* Called by STK in JNI. */
public void fromSTKEditBox(final int widget_id, final String text,
final int selection_start,
final int selection_end, final int type)