forked from qpython-android/developer.qpython.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIntent.html
1 lines (1 loc) · 5.03 KB
/
Intent.html
1
<head><title>Intent</title></head><body><p><font color=#007f00>'Common <b>Intent</b> Constants , for more <b>Intent</b> Constants, please refer https://developer.android.google.cn/reference/android/content/<b>Intent</b>.html .\n\nYou can use them like droid.startActivity<b>Intent</b>(droid.make<b>Intent</b>(action=droid.<b>Intent</b>.ACTION_VIEW,uri="http://www.baidu.com",flags=droid.<b>Intent</b>.FLAG_ACTIVITY_NEW_DOCUMENT).result) .'</font><br><br><br><br>ACTION_MAIN='android.intent.action.MAIN'<br><br>ACTION_VIEW='android.intent.action.VIEW'<br><br>ACTION_EDIT='android.intent.action.EDIT'<br><br>ACTION_PICK='android.intent.action.PICK'<br><br>ACTION_CHOOSER='android.intent.action.CHOOSER'<br><br>ACTION_INSERT='android.intent.action.INSERT'<br><br>ACTION_DELETE='android.intent.action.DELETE'<br><br>ACTION_RUN='android.intent.action.RUN'<br><br>ACTION_SEND='android.intent.action.SEND'<br><br>ACTION_SYNC='android.intent.action.SYNC'<br><br>ACTION_SEARCH='android.intent.action.SEARCH'<br><br><br><br>FLAG_ACTIVITY_SINGLE_TOP = 536870912<br><br>FLAG_ACTIVITY_MULTIPLE_TASK = 134217728<br><br>FLAG_ACTIVITY_NEW_DOCUMENT = 524288<br><br>FLAG_ACTIVITY_CLEAR_TASK = 32768<br><br>FLAG_ACTIVITY_NEW_TASK = 268435456<br><br><br><br>EXTRA_TEXT='android.intent.extra.TEXT'<br><br>EXTRA_STREAM='android.intent.extra.STREAM'<br><br><br><br>def _intentExtras(Extras):<br><br> if not isinstance(Extras,dict):<br><br> return Extras<br><br> for Key in Extras.keys():<br><br> Val = Extras[Key]<br><br> if isinstance( Val ,( bytes, bytearray )):<br><br> Extras[Key]='\x00byte\x00'+_encode(Val).decode()<br><br> elif isinstance( Val, str ):<br><br> if Val[0:1]=='\x00':<br><br> Extras[Key]='\x00str\x00'+Val<br><br> elif isinstance( Extras, dict ):<br><br> Extras[Key]=_intentExtras(Val)<br><br> elif isinstance( Val, Uri ):<br><br> Extras[Key]='\x00uri\x00'+Val<br><br> return Extras<br><br><br><br>class _uri(str):<br><br> def __new__(cls,arg):<br><br> HEAD='\x00uri\x00'<br><br> if arg[:5]!=HEAD:<br><br> arg=HEAD+arg<br><br> return super(_uri,cls).__new__(cls,arg)<br><br> def __repr__(self):<br><br> return 'Uri("'+self[5:]+'")'<br><br> def __str__(self):<br><br> return self[5:]<br><br><br><br>from .__init__ import Android as _encode<br><br>_uri.__doc__=_encode.Uri.__doc__<br><br>from base64 import b64encode as _encode</p><a href="../qsl4a.html"><back></a></body>