I've created an android widget that I am trying to run on a real device. My Android Manifest is this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.awesomefilebuilderwidget"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<receiver android:name=".AFBWidget" android:label="@string/app_name">
<intent-filter>
<action android:name="android.appwidet.action.APPWIDGET_UPDATE"/>
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/widget_stuff"/>
</receiver>
<activity android:name=".WidgetConfig" android:label="@string/app_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
</intent-filter>
</activity>
</application>
</manifest>
I originally got the error that no launcher activity was found so I set up the Launch Action in my Run Configurations to Launch my WidgetConfig activity. This fixed the issue but the application would stop unexpectedly.
Without changing my Launch Action (Launching Default Activity), I would of course get the original no launcher found error. My app widget would then be installed to the device.
Here is the other issue: the widget doesn't show up in the list of widgets when I long click on the homescreen but I know it is on the device because it shows up in the Application Manager list.
ALSO, I have tried to add the Launcher activity in the manifest but I was corrected being told that I didn't need it. If I really do need it can someone please tell me where to put it in my Manifest?
What is the issue?
ADDED:
Logcat error when adding widget to homescreen:
10-05 21:26:54.380: D/AndroidRuntime(18023): Shutting down VM
10-05 21:26:54.380: W/dalvikvm(18023): threadid=1: thread exiting with uncaught exception (group=0x4001d5a0)
10-05 21:26:54.390: E/AndroidRuntime(18023): FATAL EXCEPTION: main
10-05 21:26:54.390: E/AndroidRuntime(18023): java.lang.RuntimeException: Unable to instantiate receiver com.example.awesomefilebuilderwidget.AFBWidget: java.lang.ClassNotFoundException: com.example.awesomefilebuilderwidget.AFBWidget in loader dalvik.system.PathClassLoader[/data/app/com.example.awesomefilebuilderwidget-1.apk]
10-05 21:26:54.390: E/AndroidRuntime(18023): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2012)
10-05 21:26:54.390: E/AndroidRuntime(18023): at android.app.ActivityThread.access$2400(ActivityThread.java:135)
10-05 21:26:54.390: E/AndroidRuntime(18023): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1101)
10-05 21:26:54.390: E/AndroidRuntime(18023): at android.os.Handler.dispatchMessage(Handler.java:99)
10-05 21:26:54.390: E/AndroidRuntime(18023): at android.os.Looper.loop(Looper.java:150)
10-05 21:26:54.390: E/AndroidRuntime(18023): at android.app.ActivityThread.main(ActivityThread.java:4333)
10-05 21:26:54.390: E/AndroidRuntime(18023): at java.lang.reflect.Method.invokeNative(Native Method)
10-05 21:26:54.390: E/AndroidRuntime(18023): at java.lang.reflect.Method.invoke(Method.java:507)
10-05 21:26:54.390: E/AndroidRuntime(18023): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-05 21:26:54.390: E/AndroidRuntime(18023): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-05 21:26:54.390: E/AndroidRuntime(18023): at dalvik.system.NativeStart.main(Native Method)
10-05 21:26:54.390: E/AndroidRuntime(18023): Caused by: java.lang.ClassNotFoundException: com.example.awesomefilebuilderwidget.AFBWidget in loader dalvik.system.PathClassLoader[/data/app/com.example.awesomefilebuilderwidget-1.apk]
10-05 21:26:54.390: E/AndroidRuntime(18023): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
10-05 21:26:54.390: E/AndroidRuntime(18023): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
10-05 21:26:54.390: E/AndroidRuntime(18023): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
10-05 21:26:54.390: E/AndroidRuntime(18023): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2003)
10-05 21:26:54.390: E/AndroidRuntime(18023): ... 10 more
ADDED UPDATED ERROR LOG AFTER ADDING
<activity android:name=".AFBWidget" android:label="@string/app_name"/>
to Manifest:
10-05 21:51:45.485: D/AndroidRuntime(3557): Shutting down VM
10-05 21:51:45.485: W/dalvikvm(3557): threadid=1: thread exiting with uncaught exception (group=0x4001d5a0)
10-05 21:51:45.505: E/AndroidRuntime(3557): FATAL EXCEPTION: main
10-05 21:51:45.505: E/AndroidRuntime(3557): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.awesomefilebuilderwidget/com.example.awesomefilebuilderwidget.WidgetConfig}: java.lang.ClassNotFoundException: com.example.awesomefilebuilderwidget.WidgetConfig in loader dalvik.system.PathClassLoader[/data/app/com.example.awesomefilebuilderwidget-1.apk]
10-05 21:51:45.505: E/AndroidRuntime(3557): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1746)
10-05 21:51:45.505: E/AndroidRuntime(3557): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1854)
10-05 21:51:45.505: E/AndroidRuntime(3557): at android.app.ActivityThread.access$1500(ActivityThread.java:135)
10-05 21:51:45.505: E/AndroidRuntime(3557): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1041)
10-05 21:51:45.505: E/AndroidRuntime(3557): at android.os.Handler.dispatchMessage(Handler.java:99)
10-05 21:51:45.505: E/AndroidRuntime(3557): at android.os.Looper.loop(Looper.java:150)
10-05 21:51:45.505: E/AndroidRuntime(3557): at android.app.ActivityThread.main(ActivityThread.java:4333)
10-05 21:51:45.505: E/AndroidRuntime(3557): at java.lang.reflect.Method.invokeNative(Native Method)
10-05 21:51:45.505: E/AndroidRuntime(3557): at java.lang.reflect.Method.invoke(Method.java:507)
10-05 21:51:45.505: E/AndroidRuntime(3557): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-05 21:51:45.505: E/AndroidRuntime(3557): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-05 21:51:45.505: E/AndroidRuntime(3557): at dalvik.system.NativeStart.main(Native Method)
10-05 21:51:45.505: E/AndroidRuntime(3557): Caused by: java.lang.ClassNotFoundException: com.example.awesomefilebuilderwidget.WidgetConfig in loader dalvik.system.PathClassLoader[/data/app/com.example.awesomefilebuilderwidget-1.apk]
10-05 21:51:45.505: E/AndroidRuntime(3557): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
10-05 21:51:45.505: E/AndroidRuntime(3557): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
10-05 21:51:45.505: E/AndroidRuntime(3557): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
10-05 21:51:45.505: E/AndroidRuntime(3557): at android.app.Instrumentation.newActivity(Instrumentation.java:1040)
10-05 21:51:45.505: E/AndroidRuntime(3557): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1738)
10-05 21:51:45.505: E/AndroidRuntime(3557): ... 11 more