Hello:)

In short, I started teaching android widgets, the task was to configure the widget when it was created. Found a lesson ( http://startandroid.ru/ru/uroki/vse-uroki-spiskom/198-urok-118-vidzhety-konfiguratsionnyj-ekran-obnovlenie.html ) I do everything on the lesson, but the activation does not crash, although the widget is created . Here is the manifesto, can not drive what is wrong? Thank :)

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ru.andrevv.autogrib"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <receiver android:name=".Widget" android:label="@string/app_name" android:configure=".ConfigActivity" > <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter> <intent-filter> <action android:name="com.example.pinger.FORCE_WIDGET_UPDATE" /> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_metadata" /> </receiver> <activity android:name=".ConfigActivity"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/> </intent-filter> </activity> </application> 

widget_metadata.xml

 <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:initialLayout="@layout/widget" android:minHeight="110dp" android:minWidth="250dp" android:updatePeriodMillis="2400000"> android:configure="ru.andrevv.autogrib.ConfigActivity"</appwidget-provider> 
  • Well, show xml / widget_metadata yourself - Shwarz Andrei
  • @ShwarzAndrei, updated the post - Accami

1 answer 1

The issue is resolved. Error in widget_metadata.xml. The correct code is:

 <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:initialLayout="@layout/widget" android:minHeight="110dp" android:minWidth="250dp" android:updatePeriodMillis="2400000" android:configure="ru.andrevv.autogrib.ConfigActivity"></appwidget-provider>