任何问题请联系WX:uu16853

买模板送网站采集器 让你轻松放开双手运营网站!

购买更多有优惠!

Android 3.0自带的天气预报例子代码 Android开发技术

Android 3.0正式版API Level 11中加入了一个天气预报例子,下面是manifest.xml中的关键代码,只是少了xml的编码头: <manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”com.example.android.weatherlistwidget”> <uses-sdk android:minSdkVersion=”11” /> <application android:label=”Weather Widget Sample”> <receiver android:name=”WeatherWidgetProvider“> <intent-filter> <action android:name=”android.appwidget.action.APPWIDGET_UPDATE” /> </intent-filter> <meta-data android:name=”android.appwidget.provider” android:resource=”@xml/widgetinfo” /> </receiver> <service android:name=”WeatherWidgetService” android:permission=”android.permission.BIND_REMOTEVIEWS” android:exported=”false” /> <provider android:name=”WeatherDataProvider” android:authorities=”com.example.android.weatherlistwidget.provider” /> </application> </manifest> 这里WeatherDataProvider.java的源码为主要是ContentProvider相关的处理,这里作为appWidget的receiver class WeatherDataPoint { String city; //城市 int degrees; //度数 WeatherDataPoint(String c, int d) { city = c; […]

100% Secure Checkout

PayPal / MasterCard / Visa