appwidget 에서 xml 을 통해 UI를 생성하는게 아니라


소스상 layout을 구현하려고 하는데요.


하기와 같이 구현했는데 적용이안되네요.^^;


혹시 다른방법으로 구현을 해야하는지요?



LinearLayout dynamicLayout;

dynamicLayout = (LinearLayout)menu.findViewById(R.id.dynLayout);

dynamicLayout.removeAllViews();


LinearLayout lLayout = new LinearLayout(context);

lLayout.setId((9000));

lLayout.setPadding(10, 0, 0, 0);

lLayout.setOrientation(LinearLayout.HORIZONTAL);

lLayout.setBackgroundColor(Color.BLUE);

lLayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));


dynamicLayout.addView(lLayout);


int widgetId = appWidgetIds[i];

Intent intent = new Intent( context, M.class );

PendingIntent pendingIntent = PendingIntent.getActivity( context, 0, intent, 0 );

RemoteViews remoteView = new RemoteViews( context.getPackageName(), R.layout.widget_layout  );


appWidgetManager.updateAppWidget( widgetId, remoteView );