當前位置: 首頁>>代碼示例>>Java>>正文


Java LocalWeatherLiveResult類代碼示例

本文整理匯總了Java中com.amap.api.services.weather.LocalWeatherLiveResult的典型用法代碼示例。如果您正苦於以下問題:Java LocalWeatherLiveResult類的具體用法?Java LocalWeatherLiveResult怎麽用?Java LocalWeatherLiveResult使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LocalWeatherLiveResult類屬於com.amap.api.services.weather包,在下文中一共展示了LocalWeatherLiveResult類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onWeatherLiveSearched

import com.amap.api.services.weather.LocalWeatherLiveResult; //導入依賴的package包/類
@Override
public void onWeatherLiveSearched(LocalWeatherLiveResult localWeatherLiveResult, int i) {
        dismissBaseDialog();
        if (i == 1000) {
                if (localWeatherLiveResult != null && localWeatherLiveResult.getLiveResult() != null) {
                        LocalWeatherLive localWeatherLive = localWeatherLiveResult.getLiveResult();
                        mWeatherInfoBean.setRealTime(localWeatherLive.getReportTime());
                        realTime.setText(mWeatherInfoBean.getRealTime() + "發布");
                        mWeatherInfoBean.setWeatherStatus(localWeatherLive.getWeather());
                        weatherStatus.setText(mWeatherInfoBean.getWeatherStatus());
                        mWeatherInfoBean.setTemperature(localWeatherLive.getTemperature() + "°");
                        temperature.setText(mWeatherInfoBean.getTemperature());
                        mWeatherInfoBean.setWind(localWeatherLive.getWindDirection() + "風       " + localWeatherLive
                                .getWindPower() + "級");
                        wind.setText(mWeatherInfoBean.getWind());
                        mWeatherInfoBean.setHumidity("濕度       " + localWeatherLive.getHumidity() + "%");
                        humidity.setText(mWeatherInfoBean.getHumidity());
                } else {
                        LogUtil.e("獲取到的天氣實時信息為空");
                }
        } else {
                LogUtil.e("獲取到的天氣實時信息失敗" + i);
        }
}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:25,代碼來源:WeatherInfoActivity.java

示例2: onWeatherLiveSearched

import com.amap.api.services.weather.LocalWeatherLiveResult; //導入依賴的package包/類
@Override
public void onWeatherLiveSearched(LocalWeatherLiveResult localWeatherLiveResult, int rCode) {
    if (rCode == 1000) {
        if (localWeatherLiveResult.getLiveResult() != null) {

            LocalWeatherLive weatherlive = localWeatherLiveResult.getLiveResult();
            mWeatherWInfo.setText(weatherlive.getWeather());

            mWeatherTime.setText(weatherlive.getReportTime().substring(11, 16) + "  發布");
            mWeatherWind.setText(weatherlive.getWindDirection() + "風  " + weatherlive.getWindPower() + "級");
            mWeatherTemp.setText("溫度  " + weatherlive.getTemperature() + "°");
            mWeatherHumidity.setText("濕度  " + weatherlive.getHumidity() + "%");

            initWeatherNumber();
        }
    } else {
        ToastUtils.showToast(WeatherActivity.this, "No Result:" + rCode);
    }
}
 
開發者ID:monsterLin,項目名稱:Pigeon,代碼行數:20,代碼來源:WeatherActivity.java

示例3: onWeatherLiveSearched

import com.amap.api.services.weather.LocalWeatherLiveResult; //導入依賴的package包/類
/**
 * 實時天氣查詢回調
 */
@Override
public void onWeatherLiveSearched(LocalWeatherLiveResult weatherLiveResult, int rCode) {
    if (rCode == 1000) {
        if (weatherLiveResult != null && weatherLiveResult.getLiveResult() != null) {

            LocalWeatherLive weatherlive = weatherLiveResult.getLiveResult();
            mView.updateLiveTextView(weatherlive.getReportTime() + "發布",
                    weatherlive.getWeather(),
                    weatherlive.getTemperature() + "°",
                    weatherlive.getWindDirection() + "風     " + weatherlive.getWindPower() + "級",
                    "濕度         " + weatherlive.getHumidity() + "%");
        } else {
            mView.showToast(R.string.no_result);
        }
    } else {
        // 數據出錯
        mView.showToast("Error:" + rCode);
    }
    mView.closeProgressDialog();
}
 
開發者ID:Alex-ZHOU,項目名稱:VMAndroid,代碼行數:24,代碼來源:WeatherPresenter.java

示例4: onWeatherLiveSearched

import com.amap.api.services.weather.LocalWeatherLiveResult; //導入依賴的package包/類
/**
 * 實況天氣返回查詢
 */
@Override
public void onWeatherLiveSearched(LocalWeatherLiveResult localWeatherLiveResult, int i) {
    LocalWeatherLive localWeatherLive = localWeatherLiveResult.getLiveResult();

    mRecordView.setWeather(localWeatherLive.getWeather() + " " + localWeatherLive.getTemperature() + "°");
}
 
開發者ID:Alex-ZHOU,項目名稱:VMAndroid,代碼行數:10,代碼來源:MainPresenter.java


注:本文中的com.amap.api.services.weather.LocalWeatherLiveResult類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。