extern class NativeIntent in "Java" `{ android.content.Intent `}
super JavaObject
- redef type SELF: NativeIntent
fun add_category(category: JavaString) in "Java" `{ recv.addCategory(category); `}
fun add_flags(flags: Int) in "Java" `{ recv.addFlags((int)flags); `}
`}
fun to_native_s: JavaString in "Java" `{ return recv.toString(); `}
fun to_uri(flags: Int): JavaString in "Java" `{ return recv.toUri((int)flags); `}
+
+ # HACK for bug #845
+ redef fun new_global_ref import sys, Sys.jni_env `{
+ Sys sys = NativeIntent_sys(recv);
+ JNIEnv *env = Sys_jni_env(sys);
+ return (*env)->NewGlobalRef(env, recv);
+ `}
end
extern class NativePackageManager in "Java" `{ android.content.pm.PackageManager `}
# The general action to be performed
#
- # Example :
- # ~~~
+ # ~~~nitish
+ # # TODO better example
# intent.action = intent_action.view.to_s
# ~~~
fun action=(action: String)
# Add category to the intent
# Only activities providing all of the requested categories will be used
#
- # Example :
- # ~~~
+ # ~~~nitish
+ # # TODO better example
# intent.add_category(intent_category.home.to_s)
# ~~~
# Returns `self` allowing fluent programming
# Add a flag to be used by the intent
#
- # Example :
- # ~~~
+ # ~~~nitish
+ # # TODO better example
# intent.add_flags(intent_flag.activity_new_task)
# ~~~
# Returns `self` allowing fluent programming
# Returns `self` allowing fluent programming
fun []=(name: String, value: nullable Serializable): Intent
do
- var serialized_string = new StringOStream
+ var serialized_string = new StringWriter
var serializer = new JsonSerializer(serialized_string)
serializer.serialize(value)
end
# Allows user to get values with enum-like syntax : `intent_action.main`
-protected fun intent_action: Action do return once new Action
+fun intent_action: Action do return once new Action
# Allows user to get values with enum-like syntax : `intent_category.home`
-protected fun intent_category: Category do return once new Category
+fun intent_category: Category do return once new Category
# Allows user to get values with enum-like syntax : `intent_flag.activity_brought_to_front`
-protected fun intent_flag: Flag do return once new Flag
+fun intent_flag: Flag do return once new Flag
private class StringCopyArray
var collection = new Array[String]