Created
February 18, 2015 13:24
-
-
Save ruby0x1/9a7da1456d42b09c6386 to your computer and use it in GitHub Desktop.
Example android JAR utility written in haxe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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