Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to install custom widget on phone?
    primarykey
    data
    text
    <p>I have just made very simple widget, have installed it on emulator and it works. But if i try to install on phone I will have my application crashed. Check this code please:</p> <p>Layout for widget:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@android:color/white" android:layout_gravity="center"&gt; &lt;TextView android:id="@+id/widget_textview" android:text="Hello Widget" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center" android:textColor="@android:color/black"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>AppWidget provider(xml folder):</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="146dip" android:minHeight="72dip" android:updatePeriodMillis="86400000" android:initialLayout="@layout/main" /&gt; </code></pre> <p>Android Manifest:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.nda.widget" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="7" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" &gt; &lt;receiver android:name=".HelloWigdet" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.appwidget.action.APPWIDGET_UPDATE" /&gt; &lt;/intent-filter&gt; &lt;meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_provider_info" /&gt; &lt;/receiver&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload