hi,

i solved this issue recently.
if you don't want to start with activity, you can hide an initial activity
with the source below.


1. add an android theme to hide
<activity
           android:name=".InfoActivity" *
android:theme="@android:style/Theme.Holo.Light.Panel"
*           android:label="@string/title_info">

           <intent-filter>
               <action android:name="android.intent.action.MAIN" />
               <category
android:name="android.intent.category.LAUNCHER" />
           </intent-filter>
       </activity>
2. finish the activity as soon as it starts

and you can see the widget in the list after the first installation.

2011/11/10 Jaeyun Noh <[email protected]>

> Thanks a lot. It helps much!
>
> Adding an activity in Androidmanifest.xml like the following can solve
> the problem?
> Then does it mean that starting this widget incurs new InfoActivity
> run at an initial start?
>
> ......
>        <activity
>            android:name=".InfoActivity"
>            android:label="@string/title_info">
>
>            <intent-filter>
>                <action android:name="android.intent.action.MAIN" />
>                <category
> android:name="android.intent.category.LAUNCHER" />
>            </intent-filter>
>        </activity>
> ......
>
>
> Regards,
> Jaeyun
>
> On Nov 4, 9:25 pm, Mark Murphy <[email protected]> wrote:
>  > On Fri, Nov 4, 2011 at 2:32 AM,sincere6<[email protected]> wrote:
> > > I developed the widget app that runs on honeycomb OS. (Actually the
> > > hardware is Samsung Galaxy Tab.)
> > > When I installed the developed widget, it should be in the list of
> > > runnable widget list by pressing desktop screen for a few seconds. But
> > > it's not.
> >
> > Correct.
> >
> > > Only the OS reboot solves the problem.
> >
> > Actually, I am surprised that solves the problem. Another solution is
> > for the user to run an activity associated with your app, at least in
> > my experience.
> >
> > > BTW, when I installed the same widget into the mobile phone whose OS
> > > is froyo, it goes into the runnable widget list instantly.
> >
> > > Any clue or hint on this problem?
> >
> > With Android 3.1+, applications are installed in a "stopped" state.
> > Among other things, they will not receive broadcast Intents until they
> > are moved out of this state. The only way I know of to do this is to
> > launch an activity associated with the application. In particular, at
> > least for ACTION_BOOT_COMPLETED, a reboot was insufficient.
> >
> > I was just experimenting with app widgets and 3.2/4.0 yesterday (XOOM
> > and emulator, respectively). I encountered the same issue of not
> > seeing the app widgets available for adding to the home screen. Once I
> > launched an activity associated with the app, the app widgets
> > appeared.
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com|
> http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>  >
> > Warescription: Three Android Books, Plus Updates, One Low Price!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to