Wenn ich meine ImegeView aktualisieren möchte, sehe ich "Problem beim Laden Widget";ImageVIEW in Widget Android aktualisieren
Mein main.xml
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="280dp"
android:layout_height="120dp"
android:background="@drawable/widget_bg"
>
<ImageView
android:name="@+id/image_in_widget"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</AbsoluteLayout>
Mein Widget.java
package endoftheworld.wid;
//some imports
public class Widget extends AppWidgetProvider {
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)
{
RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.main);
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.pulse);
updateViews.setImageViewBitmap(R.id.image_in_widget,bitmap);
appWidgetManager.updateAppWidget(appWidgetIds, updateViews);
super.onUpdate(context, appWidgetManager, appWidgetIds);
}
}
In DDMS kann ich
AppWidgetHostView(128): android.widget.RemoteViews$ActionException: can't find view: 0x7f060000
Aber ich habe sehen 0x7f060000 in R.java
//....
public static final class id {
public static final int image_in_widget=0x7f060000;
}
//...
Ich benutze Android-Plattform 2.3.1 API Level 9 CPU/ABI ARM (armeabi).
Was ist ein Trick?