|
发表于 2013-1-2 16:09:05
|
显示全部楼层
22# glacierlee
7 G. I" I# B; `$ @5 [8 a/ ~
; ?# |7 k) T: t5 ~1. 直接调用主界面进行查询:
* ]' O7 p0 V5 t" |Intent intent = new Intent();
( ?+ t i9 C( A) _$ N% o$ Iintent.setAction("bluedict.intent.action.SEARCH");
+ u( v; E1 S1 r: ^0 l) ^intent.putExtra("EXTRA_QUERY", "good"); // 其中的 good 就是要查询的内容。" L" z9 @9 q4 K& w* ?* f* s
startActivity(intent);5 a; U3 ~: h" ~, M. Z2 R' G
' [4 m! Y4 m/ }2. 调用 BlueDict 中浮动式窗口进行查询:
! }" H$ m3 ^0 YIntent intent = new Intent();) a% E( A; ], j, N- Y& g
intent.setAction("bluedict.intent.action.FLOATSEARCH");! v! v5 D+ E0 h
intent.putExtra("EXTRA_QUERY", "good"); // 其中的 good 就是要查询的内容。
( Q, A5 ?! @ Cintent.putExtra("EXTRA_FULLSCREEN", false); // 是否全屏模式。4 G4 ~% `% g. X3 n F/ w5 u
intent.putExtra("EXTRA_GRAVITY",Gravity.BOTTOM); // 浮动窗口在上方还是下方,可取" m' y5 M( ] {( K) M. I
值 Gravity.BOTTOM 或 Gravity.TOP;4 W& I7 X8 N: o s7 \
intent.putExtra("EXTRA_HEIGHT", 500); // 浮动窗口的高度值,单位是像素; r6 t2 K9 b" Z! E1 T% T( @
intent.putExtra("EXTRA_MARGIN_LEFT",4); // 上 , 下 , 左 , 右的 Margin 值 , 单位是像素 。6 O0 h$ h, I: {: u/ I
intent.putExtra("EXTRA_MARGIN_RIGHT",4);3 ^3 k* }' r/ n( R
intent.putExtra("EXTRA_MARGIN_TOP",4);
( c, m' k( M. N* h" Uintent.putExtra("EXTRA_MARGIN_BOTTOM",4);
7 o% J; A, e% p2 _' ?startActivity(intent); |
|