Skip to content

Instantly share code, notes, and snippets.

@ruby0x1
Created February 18, 2015 13:24
Show Gist options
  • Save ruby0x1/9a7da1456d42b09c6386 to your computer and use it in GitHub Desktop.
Save ruby0x1/9a7da1456d42b09c6386 to your computer and use it in GitHub Desktop.
Example android JAR utility written in haxe
// http://notes.underscorediscovery.com/haxe-from-1000ft
import android.util.Log;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.net.Uri;
import android.content.Intent;
@:nativeGen
class URLUtil {
static var CUSTOM_TAG = 'URLUtil';
public static function open( activity:Activity, url:String ) {
Log.i(CUSTOM_TAG, "opening url " + url );
var intent:Intent = new Intent(Intent.ACTION_VIEW,Uri.parse(url));
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY|Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
activity.startActivity(intent);
} //open
} //URLUtil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment