RE: [android-developers] Re: Bounce animation

2010-07-14 Thread Ericson, Anders
Bouncing as you describe it is not supported in ListView. It is possible to 
lift the ListView class from the platform and modify it to support it (most of 
the necessary changes are in AbsListView btw), but I don't recommend that 
approach. Instead, I would recommend that you implement your own list view.

I've made a tutorial for how to make a custom list view (which has support for 
bounce) which is available here: 
http://blogs.sonyericsson.com/developerworld/category/tutorials/3d-list/

If you're not interested in changing appearance, you can probably skip part 2.

Good luck

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of Sandy
Sent: den 13 juli 2010 17:38
To: Android Developers
Subject: [android-developers] Re: Bounce animation

Can someone please comment on this?

Also, when height of one vertical list item is increased, it should
result in the slide animation of the rest of the items in the list
view (basically other items should slide down). I have noticed that
list view does not support this, but any other suggestions on what is
the best approach to achieve this?

Thanks,
Sandy

On Jul 12, 5:38 pm, Sandy snarr...@gmail.com wrote:
 I've noticed that in froyo on nexus 1, app menu thumbnail list can be
 scrolled up and down and, as it's scrolled, the applications roll up
 into a 3D cube instead of disappearing from the screen. Once the
 bottom of the application thumbnail list is hit, the screen bounces
 off similar to the iPhone functionality.

 Is the bounce effect at the boundaries of the list available on a
 vertical ListView? If not, is it easy to customize this in on vertical
 lists?

 Thanks,
 Sandy

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] Scrolling ListView manually by pixels

2010-07-14 Thread Ericson, Anders
Hi,

You can inject motion events to your ListView that corresponds to a 10 pixel 
drag. Create an ACTION_DOWN event and then an ACTION_UP event 10 pixels apart 
and then send them to the ListView using onTouchEvent(). You might need to have 
a ACTION_MOVE event as well. 

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of yuku
Sent: den 14 juli 2010 08:12
To: Android Developers
Subject: [android-developers] Scrolling ListView manually by pixels

Hi,

I want to make use of the trackball or d-pad to scroll my ListView
smoothly.
Without implementing anything, by default the list scrolls by one
item, which is not appropriate for my app, since list items have
different heights and I just want to scroll it by a fixed amount.

Is there anything to call to let's say, emulate a 10 pixel drag down?

Thanks.
Yuku

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] Re: Carousel like Gallery.

2010-06-23 Thread Ericson, Anders
I don't think that is possible. You probably need to write your own gallery 
like view to do that.

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of RANJAN BANIK
Sent: den 23 juni 2010 17:05
To: Android Developers
Subject: [android-developers] Re: Carousel like Gallery.

Please, answer please

Ranjan

On May 7, 1:57 am, Abdul Mateen abmat...@gmail.com wrote:
 Hi,
 Any body knows how to make a gallery circular and behave like carousel in
 Android ?

 --

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group 
 athttp://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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] How to launch browser from wallpaper?

2010-06-17 Thread Ericson, Anders
Hi,

Doing 
Activity activity = new Activity()
is probably not a good idea.

instead, get the application context from the wallpaper:
getApplicationContext().startActivity(i);

That will probably work better.

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of Stu.Axon
Sent: den 17 juni 2010 11:30
To: Android Developers
Subject: [android-developers] How to launch browser from wallpaper?

I'm trying to launch the browser from a wallpaper, but I get a
NullpointerException...
code looks like this:

Intent i = new Intent();

i.setAction(Intent.ACTION_VIEW);
i.addCategory(Intent.CATEGORY_BROWSABLE);
i.setData(Uri.parse(http://google.com;));

Activity activity = new Activity();
activity.startActivity(i);

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] Dynamically obtaining several instance of a view item defined in layout/xml file

2010-06-10 Thread Ericson, Anders
Hi,

Just inflate from the xml each time you want a new instance of that particular 
view. Like this:

View innerRL = LayoutInflater.from(context).inflate(R.layout.inner_view, null);

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of krishna
Sent: den 8 juni 2010 02:37
To: Android Developers
Subject: [android-developers] Dynamically obtaining several instance of a view 
item defined in layout/xml file

I have a relative layout (let's say innerRL place in layout
inner_view.xml) which I wanna add to another layout (main_layout), I
wanna dynamically add multiple instances of innerRL. Specifying
innerRL in xml gives me ease of maintenance (as against doing totally
in the code), however I want to be able to add several instances
dynamically. Using findViewById(resource_id) gives me that particular
instance, should I have to use clone()?

One other approach I see is ArrayAdapter, but it seems overkill.

-Krishna

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] Placing a bitmap image in ImageView

2010-06-10 Thread Ericson, Anders
Sounds like you want to change the scale type on the image view. 

http://developer.android.com/reference/android/widget/ImageView.ScaleType.html

/Anders

--
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of pawan nimje
Sent: den 9 juni 2010 19:39
To: Android Developers
Subject: [android-developers] Placing a bitmap image in ImageView

Hi All,

I have a Bitmap image (bm) and a an ImageView (iv) of 50 by 50

when i do iv.setImageBitmap(bm) ... only a portion of the entire image is seen 
..How can i see the whole image in the 50 dip by 50 dip ImageView ..

any suggestion will do ..
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] Is Android's onTouchEvent() dispatching accurate??

2010-06-09 Thread Ericson, Anders
I would say that this is normal behavior. The up-event can definitely have (and 
often has) another coordinate than the last move-event. But I don't think it 
has anything to do with inaccuracy in the touch event handling, it's simply the 
way it works...

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of Peterdk
Sent: den 6 juni 2010 17:30
To: Android Developers
Subject: [android-developers] Is Android's onTouchEvent() dispatching accurate??

I have a weird bug in my piano app. Sometimes keys (and thus notes)
hang. I did a lot of debugging and narrowed it down to what looks like
androids inaccuracy of motion event handling:

 DEBUG/(2091): ACTION_DOWN A4
 DEBUG/(2091): KeyDown: A4
 DEBUG/(2091): ACTION_MOVE A4 = A4
 DEBUG/(2091): ACTION_MOVE ignoring since equal note
 DEBUG/(2091): ACTION_MOVE A4 = A4
 DEBUG/(2091): ACTION_MOVE ignoring since equal note
 DEBUG/(2091): ACTION_MOVE A4 = A4
 DEBUG/(2091): ACTION_MOVE ignoring since equal note
 DEBUG/(2091): ACTION_UP B4 //HOW CAN THIS BE
 DEBUG/(2091): KeyUp: B4
 DEBUG/(2091): Stream is null, can't stop
 DEBUG/(2091): Hanging Note: A4 X=240-287 EventX=292 Y=117-200
EventY=164
 DEBUG/(2091): KeyUp Note:   B4 X=288-335 EventX=292 Y=117-200
EventY=164

Clearly it can be seen here that out of nowhere I suddenly have an
ACTION_UP for another note. Shouldn't I definitely get a ACTION_MOVE
first?

As shown in the end of the log, it's definitely not an error in region
detection, since the ACTION_UP event is clearly in the B4 region.


Every onTouchEvent() call is logged, so the log is accurate.

The relevant pseudo-code for the ACTION_MOVE logging is:

 Key oldKey = Key.get(event.getHistoricalX(), event.getHistoricalY());
 Key newKey = Key.get(event.getX(), event.getY());


Is this normal behaviour for Android (the jumping in coordinates)??
Can ACTION_UP events just arise without any previous ACTION_MOVE
towards it coordinates??


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] Re: Android graphical capabilities

2010-06-04 Thread Ericson, Anders
Yeah, it's the dynamics that really give it a nice feel. And a touch-list 
without fling support is not useful at all...

Though the third part of the tutorial is not quite ready yet. It will probably 
be posted in about a week on the blog. Untill then I suggest playing around 
with the graphics :)

BTW, if you (or anyone else) have any ideas or requests for other tutorials, 
let me know! We are planning to continue with tutorials and it would be great 
if you had any input. No promises though :)

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of Neilz
Sent: den 3 juni 2010 20:16
To: Android Developers
Subject: [android-developers] Re: Android graphical capabilities

Hi Anders.

Do you have the code for part 3 available?

The first two are great, but really it's not so great without the
finishing touches from part 3!

On Jun 3, 2:18 pm, Ericson, Anders anders.eric...@sonyericsson.com
wrote:
 The reference app on market has minSdkVersion set to 4 (=1.6) and the main 
 reason is to enable the support for different screen sizes (mdpi, ldpi, 
 hdpi). The code itself has very little (if any) dependencies to 1.6 specific 
 APIs. You can always download the code and just rename the directories for 
 the drawables, that should be enough to get it to work on a 1.5 device.

 We'll look into supporting 1.5 for the reference app as well.

 /Anders

 -Original Message-
 From: android-developers@googlegroups.com 
 [mailto:android-develop...@googlegroups.com] On Behalf Of Neilz
 Sent: den 3 juni 2010 14:21
 To: Android Developers
 Subject: [android-developers] Re: Android graphical capabilities

 Hi Anders.

 Thanks for these, they look great, just the sort of thing I'm after.

 I notice that it isn't available for my older Hero with 1.5. Is this
 not compatible with 1.5? How would you resolve that if you wanted your
 app to reach all devices?

 On Jun 3, 11:37 am, Ericson, Anders
 anders.eric...@sonyericsson.com wrote:
  Hi,

  I recently wrote a tutorial on how to do a cool 3D list. You can find the 
  latest part on:

 http://blogs.sonyericsson.com/developerworld/category/tutorials/

  There you can also find a tutorial on how to do a cool zoom written by a 
  colleague of mine.

  /Anders

  -Original Message-
  From: android-developers@googlegroups.com 
  [mailto:android-develop...@googlegroups.com] On Behalf Of Neilz
  Sent: den 3 juni 2010 10:38
  To: Android Developers
  Subject: [android-developers] Android graphical capabilities

  My apps are functionally good, and in my time learning android I have
  covered most features. But one thing my apps lack is graphical
  coolness... you know the type of thing the top branded apps have, and
  particularly those from the iPhone which are always very impressive.

  I want to improve my graphical skills for layouts, menus, galleries,
  interactive buttons - the kind of stuff that makes your apps look
  great, as well as performing well.

  What should I look at? Where should I start?

  Any links, tips, welcome!

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group 
  athttp://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 android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group 
 athttp://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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] Set wallpaper as background

2010-06-03 Thread Ericson, Anders
Hi,

In your AndroidManifest.xml you can add this to your activity:
android:theme=@android:style/Theme.Wallpaper

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of AndroidNewbie
Sent: den 3 juni 2010 05:49
To: Android Developers
Subject: [android-developers] Set wallpaper as background

Hi ,

I want to set current wallpaper as my application background . Any
ideas to do it through XML or Java code ?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] Android graphical capabilities

2010-06-03 Thread Ericson, Anders
Hi,

I recently wrote a tutorial on how to do a cool 3D list. You can find the 
latest part on:

http://blogs.sonyericsson.com/developerworld/category/tutorials/

There you can also find a tutorial on how to do a cool zoom written by a 
colleague of mine.

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of Neilz
Sent: den 3 juni 2010 10:38
To: Android Developers
Subject: [android-developers] Android graphical capabilities

My apps are functionally good, and in my time learning android I have
covered most features. But one thing my apps lack is graphical
coolness... you know the type of thing the top branded apps have, and
particularly those from the iPhone which are always very impressive.

I want to improve my graphical skills for layouts, menus, galleries,
interactive buttons - the kind of stuff that makes your apps look
great, as well as performing well.

What should I look at? Where should I start?

Any links, tips, welcome!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] Re: Android graphical capabilities

2010-06-03 Thread Ericson, Anders
The reference app on market has minSdkVersion set to 4 (=1.6) and the main 
reason is to enable the support for different screen sizes (mdpi, ldpi, hdpi). 
The code itself has very little (if any) dependencies to 1.6 specific APIs. You 
can always download the code and just rename the directories for the drawables, 
that should be enough to get it to work on a 1.5 device.

We'll look into supporting 1.5 for the reference app as well. 

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of Neilz
Sent: den 3 juni 2010 14:21
To: Android Developers
Subject: [android-developers] Re: Android graphical capabilities

Hi Anders.

Thanks for these, they look great, just the sort of thing I'm after.

I notice that it isn't available for my older Hero with 1.5. Is this
not compatible with 1.5? How would you resolve that if you wanted your
app to reach all devices?

On Jun 3, 11:37 am, Ericson, Anders
anders.eric...@sonyericsson.com wrote:
 Hi,

 I recently wrote a tutorial on how to do a cool 3D list. You can find the 
 latest part on:

 http://blogs.sonyericsson.com/developerworld/category/tutorials/

 There you can also find a tutorial on how to do a cool zoom written by a 
 colleague of mine.

 /Anders

 -Original Message-
 From: android-developers@googlegroups.com 
 [mailto:android-develop...@googlegroups.com] On Behalf Of Neilz
 Sent: den 3 juni 2010 10:38
 To: Android Developers
 Subject: [android-developers] Android graphical capabilities

 My apps are functionally good, and in my time learning android I have
 covered most features. But one thing my apps lack is graphical
 coolness... you know the type of thing the top branded apps have, and
 particularly those from the iPhone which are always very impressive.

 I want to improve my graphical skills for layouts, menus, galleries,
 interactive buttons - the kind of stuff that makes your apps look
 great, as well as performing well.

 What should I look at? Where should I start?

 Any links, tips, welcome!

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group 
 athttp://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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] how to enable onItemClick for custom list view

2010-06-03 Thread Ericson, Anders
Hi,

The way it works is that if your list item (or a part of your list item) is 
clickable (like the button) it will steal the touch event from the ListView, 
so the ListView will not be able to call onItemClick().

One way to solve it is to set a click listener to the button in each item view. 
This can be done from the adaptor. Though you need to make sure you don't leak 
listeners. You can for example set the same listener to all items and figure 
out exactly what item was pressed by tagging the item-views with the position, 
and then checking the tag in the onClick() callback.

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of prachi
Sent: den 3 juni 2010 15:58
To: Android Developers
Subject: [android-developers] how to enable onItemClick for custom list view

Hey hiii all


I hav a list view,each list item has a text view and a button.

My onItemClick() for list item is not responding.But if i remove the
button from list item it is responding..

Pl helppp bcoz i want both to function  :(:(:(


Any help would be appreciated:):):)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] sendWallpaperCommand() behavior changed in 2.2

2010-06-01 Thread Ericson, Anders
Hi,

Why should only the Home application send commands to the wallpaper? Shouldn't 
any application that displays the wallpaper as background be able to send 
commands?

Also, the documentation for WallpaperManager.sendWallpaperCommand() is a bit 
unclear. The documentation for the parameter windowToken says he window who 
these offsets should be associated with, as returned by 
View.getWindowToken().. What offsets are referred to here? I can understand 
the same documentation in setWallpaperOfffsets() or clearWallpaperOffsets, but 
not in sendWallpapperCommand().

/Anders Ericson

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of Romain Guy
Sent: den 1 juni 2010 11:49
To: android-developers@googlegroups.com
Subject: Re: [android-developers] sendWallpaperCommand() behavior changed in 2.2

Hi,

From where are you sending a command? Commands are supposed to be sent
by the Home application. In which case you have views and you can get
the window token from any of these views.

On Tue, Jun 1, 2010 at 2:44 AM, String sterling.ud...@googlemail.com wrote:
 I'm seeing a bothersome change in behavior of the live wallpaper SDK
 in Android 2.2. Specifically, it's the windowToken parameter to
 WallpaperManager.sendWallpaperCommand(); in the docs it's described as
 The window who these offsets should be associated with, as returned
 by View.getWindowToken(). Which sounds fine, but if the live
 wallpaper I'm trying to send a command to is the main one - on the
 home screen - what view should this be?

 In 2.1, I could send a null for this parameter, and it worked fine -
 my live wallpaper got the command. In 2.2, the null produces a crash
 by the system. Here's a logcat trace, FWIW:

 E/WindowManager(   85): Window Session Crash
 E/WindowManager(   85): java.lang.IllegalArgumentException: Requested
 window null does not exist
 E/WindowManager(   85):         at
 com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:
 9244)
 E/WindowManager(   85):         at
 com.android.server.WindowManagerService
 $Session.sendWallpaperCommand(WindowManagerService.java:6827)
 E/WindowManager(   85):         at android.view.IWindowSession
 $Stub.onTransact(IWindowSession.java:345)
 E/WindowManager(   85):         at
 com.android.server.WindowManagerService
 $Session.onTransact(WindowManagerService.java:6694)
 E/WindowManager(   85):         at
 android.os.Binder.execTransact(Binder.java:288)
 E/WindowManager(   85):         at
 dalvik.system.NativeStart.run(Native Method)

 Fortunately, this crash is invisible to the user, but that's small
 consolation as the command never reaches my wallpaper.

 Has anyone worked out how to get a window token for the home screen?
 Or any other way around this? Or any other way to send a message to
 the currently running live wallpaper?

 Thanks,

 String

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




-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en