Welcome to the Android Central Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
+ Reply Subscribe
Results 1 to 1 of 1
  1. Thread Author  Thread Author    #1  
    AC Question
    AC Question's Avatar
    Guest

    Default WIDGET

    bonjour,
    je viens de crée un widget(non fonctionnel) cad juste l'interface graphique mais il n'apparait pas dans l'émulteur,sachant qu'il ny a aucun bug. donc si vous pouviez me dire pourquoi... et je soupçonne la faute au niveau de l'androidManifest

    MainActivity

    package com.example.widget;


    import android.appwidget.AppWidgetProvider;

    public class MainActivity extends AppWidgetProvider{
    }


    FragmentMain

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:orientation="vertical"
    android:layout_gravity="center"
    android:layout_height="wrap_content"
    android:background="@drawable/heyehy"
    >

    <TextView
    android:id="@+id/number"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="0"
    android:textSize="80sp"
    android:textStyle="bold"
    android:textColor="#FF0000"

    />

    <ImageButton
    android:id="@+id/boutonplus"
    android:layout_width="92dp"
    android:layout_height="wrap_content"
    android:layout_above="@+id/boutonClear"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="28dp"
    android:layout_toRightOf="@+id/number"
    android:src="@drawable/beer128" />


    <Button
    android:id="@+id/boutonmoin"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_below="@+id/number"
    android:layout_marginTop="16dp"
    android:text="-"
    />

    <Button
    android:id="@+id/boutonClear"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_toRightOf="@id/boutonmoin"
    android:layout_alignTop="@id/boutonmoin"
    android:text="clear"
    android:layout_alignRight="@id/boutonplus"
    />

    </RelativeLayout>

    AndroidManifest


    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.widget"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="19" />

    <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <receiver
    android:name="com.example.widget.MainActivity"
    android:label="@string/app_name"
    android:icon="@drawable/ic_launcher" >
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />

    <action android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <meta-data android:name="android.appwidget.provider"
    android:resource="@xml/my_widget_provider" />
    </receiver>
    </application>

    </manifest>


    MyWidgetProvider



    <?xml version="1.0" encoding="utf-8"?>
    <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
    android:minWidth="160dip"
    android:minHeight="80dip"
    android:updatePeriodMillis="1000000"
    android:initialLayout="@layout/fragment_main"


    />

Similar Threads

  1. Direct Dial Widget Samsung Galaxy S4 Verixon
    By AC Question in forum Ask a Question
    Replies: 2
    Last Post: 08-25-2014, 06:31 AM
  2. same widget twice?
    By ItIs in forum Ask a Question
    Replies: 1
    Last Post: 07-19-2014, 12:06 PM
  3. Email -Stock widget settings?
    By LauraWA in forum LG G3
    Replies: 0
    Last Post: 07-18-2014, 06:20 PM
  4. Replies: 0
    Last Post: 07-17-2014, 01:29 PM
  5. How to get rid of Grey (fugly) shortcuts widget
    By George H Martin in forum Samsung Galaxy Tab4 10.1
    Replies: 1
    Last Post: 07-15-2014, 04:37 PM

Posting Permissions