1
I wonder why this layout is not displayed in my widget:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".Main" >
<RelativeLayout
android:orientation="vertical"
android:id="@+id/Seg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="5dp"
android:background="@drawable/shape_layout" >
<View
android:id="@+id/view1"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="@color/vermelho" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/view1"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="3dp"
android:contentDescription="@string/todo"
android:src="@drawable/data" />
<ImageButton
android:id="@+id/SaveSeg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/view1"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="5dp"
android:background="@null"
android:contentDescription="@string/todo"
android:src="@drawable/edit_button" />
<TextView
android:id="@+id/SegView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/view1"
android:layout_centerHorizontal="true"
android:text="@string/seg"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/branco"
android:textSize="28sp" />
<TextView
android:id="@+id/Data1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/view1"
android:layout_alignLeft="@+id/imageView1"
android:layout_marginBottom="4dp"
android:layout_marginLeft="10dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/preto" />
<TextView
android:id="@+id/MainS1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/view1"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/branco"
android:textSize="25sp" />
<TextView
android:id="@+id/MainS2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/MainS1"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/branco"
android:textSize="25sp" />
<TextView
android:id="@+id/MainS3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/MainS2"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/branco"
android:textSize="25sp" />
<TextView
android:id="@+id/MainS4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/MainS3"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/branco"
android:textSize="25sp" />
<TextView
android:id="@+id/MainS5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/MainS4"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/branco"
android:textSize="25sp" />
<TextView
android:id="@+id/MainS6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/MainS5"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/branco"
android:textSize="25sp" />
<TextView
android:id="@+id/MainS7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/MainS6"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/branco"
android:textSize="25sp" />
<TextView
android:id="@+id/SegHorario1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/MainS1"
android:layout_alignRight="@+id/SaveSeg"
android:background="@drawable/shape_edit"
android:textColor="@color/cinza"
android:textSize="20sp"
android:textStyle="italic" />
<TextView
android:id="@+id/SegHorario2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/MainS2"
android:layout_alignRight="@+id/SaveSeg"
android:background="@drawable/shape_edit"
android:textColor="@color/cinza"
android:textSize="20sp"
android:textStyle="italic" />
<TextView
android:id="@+id/SegHorario3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/MainS3"
android:layout_alignRight="@+id/SaveSeg"
android:background="@drawable/shape_edit"
android:textColor="@color/cinza"
android:textSize="20sp"
android:textStyle="italic" />
<TextView
android:id="@+id/SegHorario4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/MainS4"
android:layout_alignRight="@+id/SaveSeg"
android:background="@drawable/shape_edit"
android:textColor="@color/cinza"
android:textSize="20sp"
android:textStyle="italic" />
<TextView
android:id="@+id/SegHorario5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/MainS5"
android:layout_alignRight="@+id/SaveSeg"
android:background="@drawable/shape_edit"
android:textColor="@color/cinza"
android:textSize="20sp"
android:textStyle="italic" />
<TextView
android:id="@+id/SegHorario6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/MainS6"
android:layout_alignRight="@+id/SaveSeg"
android:background="@drawable/shape_edit"
android:textColor="@color/cinza"
android:textSize="20sp"
android:textStyle="italic" />
<TextView
android:id="@+id/SegHorario7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/MainS7"
android:layout_alignRight="@+id/SaveSeg"
android:background="@drawable/shape_edit"
android:textColor="@color/cinza"
android:textSize="20sp"
android:textStyle="italic" />
</RelativeLayout>
</LinearLayout>
you’ve already added to the manifesto?
– Israel Zebulon
As far as I know layouts should not be added to
manifest.xml
onlyActivity
's should be.– Paulo Roberto Rosa
I already added to the manifesto yes!
– Pedro Igor
How you are assigning this Layout to your @Pedroigor Widget?
– Paulo Roberto Rosa
through the
@xml/widget_info
thus:<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
 android:configure="com.example.android.ExampleAppWidgetConfigure"
 android:initialLayout="@layout/widget_layout"
 android:minHeight="300dp"
 android:minWidth="300dp"
 android:updatePeriodMillis="86400000" />

– Pedro Igor