zoukankan      html  css  js  c++  java
  • 主函数天气

    package com.coolweather.android;

    import android.content.Intent;
    import android.content.SharedPreferences;
    import android.preference.PreferenceManager;
    import android.support.v7.app.ActionBar;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;

    import static com.baidu.location.h.i.R;

    public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    if (prefs.getString("weather", null) != null) {
    Intent intent = new Intent(this, WeatherActivity.class);
    startActivity(intent);
    finish();
    }
    else {
    String weatherId="CN101110101";
    Intent intent = new Intent(this, WeatherActivity.class);
    intent.putExtra("weather_id", weatherId);
    startActivity(intent);
    finish();
    }
    }

    }
  • 相关阅读:
    JS和Flash相互调用
    xml的应用
    随机验证码
    模块 time
    第一天 注册成功
    我的第一篇博客
    git
    2018-02-27
    25
    建站之星
  • 原文地址:https://www.cnblogs.com/tianzijiaozi/p/7563461.html
Copyright © 2011-2022 走看看