Nhìn như tôi # $ #% $% # $ người nhận không phải là tôi yếu tố ứng dụng trong manifestappwidget Android không hiển thị
Hi
tôi chỉ tạo ra appwidget helloworld để xem cách nó công trinh. tôi đã làm theo ví dụ dev trên trang web adroid dev. Nhưng vì lý do nào đó, widget không muốn hiển thị trong danh sách widget.
AndroidManifest.xml
<receiver android:name="VoiceRIAWidget" android:label="Voice RIA">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/appwidget_info" />
</receiver>
appwidget_info.xml
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:label="Voice RIA" android:minWidth="50dp" android:minHeight="50dp"
android:updatePeriodMillis="86400000" android:initialLayout="@layout/appwidget">
</appwidget-provider>
VoiceRIAWidget
public class VoiceRIAWidget extends AppWidgetProvider
{
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
int[] appWidgetIds)
{
final int N = appWidgetIds.length;
for (int i = 0; i < N; i++)
{
int appWidgetId = appWidgetIds[i];
CharSequence text = "Hello";
RemoteViews views = new RemoteViews(context.getPackageName(),
R.layout.appwidget);
views.setTextViewText(R.id.appwidget_text, text);
appWidgetManager.updateAppWidget(appWidgetId, views);
}
super.onUpdate(context, appWidgetManager, appWidgetIds);
}
}
appwidget.xml
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/appwidget_text" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:textColor="#ff000000" />
Tôi không thể thấy những gì tôi thiếu nó chạy nhưng không có gì trong danh sách.