当前位置: 首页>>代码示例>>Java>>正文


Java Intent.ACTION_TIME_TICK属性代码示例

本文整理汇总了Java中android.content.Intent.ACTION_TIME_TICK属性的典型用法代码示例。如果您正苦于以下问题:Java Intent.ACTION_TIME_TICK属性的具体用法?Java Intent.ACTION_TIME_TICK怎么用?Java Intent.ACTION_TIME_TICK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.content.Intent的用法示例。


在下文中一共展示了Intent.ACTION_TIME_TICK属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onReceive

@Override
public void onReceive(Context context, Intent intent) {
    byte adjustReason;
    switch (intent.getAction()) {
        case Intent.ACTION_TIME_CHANGED:
            adjustReason = TimeProfile.ADJUST_MANUAL;
            break;
        case Intent.ACTION_TIMEZONE_CHANGED:
            adjustReason = TimeProfile.ADJUST_TIMEZONE;
            break;
        default:
        case Intent.ACTION_TIME_TICK:
            adjustReason = TimeProfile.ADJUST_NONE;
            break;
    }
    long now = System.currentTimeMillis();
    notifyRegisteredDevices(now, adjustReason);
    updateLocalUi(now);
}
 
开发者ID:androidthings,项目名称:sample-bluetooth-le-gattserver,代码行数:19,代码来源:GattServerActivity.java

示例2: onCreate

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    h1View = (ImageView)findViewById(R.id.h1);
    h2View = (ImageView)findViewById(R.id.h2);
    m1View = (ImageView)findViewById(R.id.m1);
    m2View = (ImageView)findViewById(R.id.m2);
    
    setTime();
    
    receiver = new TickReceiver();
    filter = new IntentFilter(Intent.ACTION_TIME_TICK);        
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:15,代码来源:ClockActivity.java

示例3: setReceiver

private void setReceiver() {
    IntentFilter timeFilter = new IntentFilter(Intent.ACTION_TIME_TICK);
    timeReceiver = new TimeReceiver();
    timeReceiver.setActivity(this);
    timeReceiver.setRecommendFragment((GankRecommendFragment) mFragmentList.get(0));
    internetReceiver = new InternetReceiver();
    registerReceiver(timeReceiver, timeFilter);
    internetReceiver = new InternetReceiver();
    internetReceiver.setActivity(this);
    IntentFilter InternetFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
    registerReceiver(internetReceiver, InternetFilter);
}
 
开发者ID:SirLYC,项目名称:Android-Gank-Share,代码行数:12,代码来源:MainActivity.java


注:本文中的android.content.Intent.ACTION_TIME_TICK属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。