- 博客(1)
- 资源 (3)
- 收藏
- 关注
原创 nacos1.4.1修复鉴权漏洞报longPolling错误,动态刷新失败解决方法(建议修复到最新版)
名称 版本 spring-cloud-alibaba-dependencies 2.2.4.RELEASE spring-cloud-dependencies 2020.0.0 spring-boot-dependencies 2.4.2 nacos-docker 1.4.1 父程序POM<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www....
2021-01-29 11:46:51 6270
奉献一个天气源码
已经实现网络连接端口,实时更新数据。
package com.zhong.activity;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
/**
* 寮€濮嬪惎鍔ㄧ▼搴忕晫闈? *
* @author 浠蹭笡鏃? *
*/
public class MainActivity extends FatherActivity {
private final String TAG = "MainActivity";
/** 鍒ゆ柇鏄惁鏄涓€娆¤繍琛?*/
private boolean isFirstIn = false;
/** 璺宠浆鍒颁富鐣岄潰int鍨嬫爣璁?*/
private static final int GO_USER_FARST_PAGE = 1;
/** 璺宠浆鍒板紩瀵奸〉闈nt鍨嬫爣璁?*/
private static final int GO_GUIDE = 2;
/** 璁剧疆寤惰繜鏃堕棿 */
private static final long DELAY_MILLIS = 3000;
/**
* 涓昏鍔熻兘锛岃烦杞埌涓嶅悓鐨勭晫闈? */
@SuppressLint("HandlerLeak")
private Handler mHandler = new Handler() {
public void handleMessage(android.os.Message msg) {
super.handleMessage(msg);
Log.i(TAG, "==handleMessage()");
switch (msg.what) {
case GO_USER_FARST_PAGE:
goUserFirstPage();
break;
case GO_GUIDE:
goGuidePage();
break;
}
};
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i(TAG, "==onCreate()");
initActivity(this);
init();
}
/**
* 杞欢鍦ㄨ繖涓晫闈腑瑕佸仛鐨勫垵濮嬪寲鎿嶄綔
*/
private void init() {
Log.i(TAG, "==init()");
setContentView(R.layout.activity_main);
/* 璇诲彇SharedPreferences涓渶瑕佺殑鏁版嵁,鐢ㄤ簬鍒ゆ柇鏄惁鏄娆¤繍琛?*/
SharedPreferences preferences = getSharedPreferences("first",
MODE_PRIVATE);
/* 鍙栧緱鐩稿簲鐨勫€硷紝濡傛灉娌℃湁璇ュ€硷紝璇存槑杩樻湭鍐欏叆锛岀敤true浣滀负榛樿鍊?*/
isFirstIn = preferences.getBoolean("isFirstIn", true);
/* 鍒ゆ柇鏄惁鏄涓€娆¤繍琛岋紝鏄殑璇濊烦杞埌寮曞椤?浣跨敤Handler鐨刾ostDelayed鏂规硶 */
if (isFirstIn) {
setCityFatherId("101010100");
setBgFatherId("bg_help1");
mHandler.sendEmptyMessageDelayed(GO_GUIDE, 0);
} else {
mHandler.sendEmptyMessageDelayed(GO_USER_FARST_PAGE, DELAY_MILLIS);
}
}
/**
* 鍘诲紩瀵奸〉
*/
protected void goGuidePage() {
Log.i(TAG, "==goGuidePage()");
Intent intent = new Intent(this, GuidePage.class);
startActivity(intent);
this.finish();
}
/**
* 鍘荤敤鎴烽椤? */
protected void goUserFirstPage() {
Log.i(TAG, "==goUserFirstPage()");
Intent intent = new Intent(this, UserPage.class);
startActivity(intent);
this.finish();
}
}
2014-05-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人