17
17
package com .wintmain .foundation ;
18
18
19
19
import android .app .Application ;
20
+ import android .content .ComponentName ;
20
21
import android .content .Context ;
22
+ import android .content .Intent ;
21
23
import android .os .Bundle ;
24
+ import android .provider .AlarmClock ;
22
25
import android .widget .TextView ;
23
26
import androidx .appcompat .app .AppCompatActivity ;
24
27
import androidx .appcompat .widget .AppCompatTextView ;
28
+ import com .google .android .catalog .framework .annotations .Sample ;
25
29
import lib .wintmain .titlebar .OnTitleBarListener ;
26
30
import lib .wintmain .titlebar .TitleBarExt ;
27
31
import lib .wintmain .titlebar .style .LightBarStyle ;
28
32
import lib .wintmain .toaster .toast .ToastUtils ;
29
33
30
- //@Sample(
31
- // name = "Android PfT",
32
- // description = "Android Platform for Technology.",
33
- // documentation = "",
34
- // // owners = ["wintmain"],
35
- // tags = "A-Self_demos")
34
+ @ Sample (
35
+ name = "0-Android-Demo" ,
36
+ description = "一个为了测试API调用的入口" ,
37
+ tags = "A-Self_demos" )
36
38
public class PlaceHolderActivity extends AppCompatActivity {
37
39
38
40
@ Override
@@ -54,7 +56,15 @@ public void onLeftClick(TitleBarExt titleBar) {
54
56
55
57
@ Override
56
58
public void onTitleClick (TitleBarExt titleBar ) {
57
- ToastUtils .show ("你点击了中间" );
59
+ Intent newIntent = new Intent ();
60
+ newIntent .putExtra (AlarmClock .EXTRA_HOUR , 9 );
61
+ newIntent .putExtra (AlarmClock .EXTRA_MINUTES , 30 );
62
+ newIntent .setAction (AlarmClock .ACTION_SET_ALARM );
63
+ newIntent .putExtra (AlarmClock .EXTRA_SKIP_UI , true );
64
+ newIntent .setComponent (new ComponentName ("com.android.deskclock" , "com.android.deskclock.HandleApiCalls" ));
65
+ startActivity (newIntent );
66
+
67
+ ToastUtils .show ("你点击了中间,并且新建了一个9:30的闹钟" );
58
68
}
59
69
60
70
@ Override
0 commit comments