Hello guys i am totally new to widgets i don't know how i can declare widgets in the manifest,whenever i try i get errors
the widget is communicating with a service which has already been defined in the manifest
package name package source.justanothermusicplayer.service;
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
int[] appWidgetIds) {
RemoteViews controlButtons = new RemoteViews(context.getPackageName(),
R.layout.widget);
Intent playIntent = new Intent(Player.BROADCAST_PLAYPAUSE);//player is a class which starts the service
PendingIntent playPendingIntent = PendingIntent.getService(
context, REQUEST_CODE, playIntent, INTENT_FLAGS);
controlButtons.setOnClickPendingIntent(
R.id.bPlay, playPendingIntent);
appWidgetManager.updateAppWidget(appWidgetIds, controlButtons);
}
}