[android-developers] Re: Activity lifecycle problem on Nexus One - onStop not called

2010-03-05 Thread Zuli
I agree with Mark Murphy, it seems a problem only when the home screen
is displayed after the activity, if I open another activity on top of
that (long press on HOME) or if I receive a call the onStop is
correctly called...
seems to me quite a big issue, think about all the activities that use
the onstart and onstop methods to coordinate their work, how come so
few people have noticed that?

Zuli


On Mar 5, 6:00 am, Streets Of Boston flyingdutc...@gmail.com wrote:
 mm... my app makes use of saving and restoring instance state a
 lot and it works as well on theNexusOneas on the Droid or G1. But i
 don't use the onStop callback at all. And I don't use the
 onRestoreInstanceState either. Instead, i use the
 onRetainNonConfigurationInstance() and
 getLastNonConfigurationInstance() methods. These work well for me.

 On Mar 4, 8:25 pm, Zsolt Vasvari zvasv...@gmail.com wrote:



  I think there are some issues with the background activity life cycle
  management on theNexusOne.

  In my app, I have a background and foreground activity.  When I tilt
  the phone so it switches orientation, the first time around the state
  is properly saved and restored for the background acrivity.  But if
  when flip it back, onCreate is called with NULL for the Bundle, so I
  lose state. (and no, onRestoreInstanceState is not called, either)

  I'd create a small app that demonstrates this, but frankly, it would
  be a waste of my time as it probably wouldn't get looked at anyhow.
  So just take my word for it

  Zsolt Vasvari

  On Mar 5, 4:29 am, Mark Murphy mmur...@commonsware.com wrote:

   Mark Murphy wrote:
schwiz wrote:
It should be called when you press back but not home, but I have
noticed this problem using openeclair on my G1.  Perhaps its a new
feature/bug in 2.1?

No, onStop() should be called when you press either BACK or HOME. For
some reason, it is not doing that in theNexusOne. My best guess is
that it has to do with theNexusOne'shome screen implementation, but
that's just a guess.

   BTW, here's the open issue:

  http://code.google.com/p/android/issues/detail?id=6094

   --
   Mark Murphy (a Commons 
   Guy)http://commonsware.com|http://twitter.com/commonsguy

   _Android Programming Tutorials_ Version 2.0 Available!- Hide quoted text -

  - Show quoted text -

-- 
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


[android-developers] Activity lifecycle problem on Nexus One - onStop not called

2010-03-04 Thread Zuli
Hi,
I have a problem with the activity lifecycle specifically on Nexus One
(2.1 running on emulator works fine).
If I just create a simple empty Activity with no special launchModes
that logs the calls on the onStart and onStop methods, this is what I
see:

- launch app: onStart called;
- home button: onStop NOT called;
- launch app: onStart NOT called;
- home button: onStop NOT called:

and so on. Sometimes if I press the back button then the onStop is not
called, but the when i launch the activity again the onStart is called
and right after the onStop is called.
Similar results with different launchModes...

What is going on? Can anyone confirm this?

Zuli


i found an android issue for the problem here:
http://code.google.com/p/android/issues/detail?id=6094
and a similar thread here
http://groups.google.com/group/android-developers/browse_thread/thread/852b8f78c6ab7f73/5a49510d27d572f4

-- 
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


[android-developers] Re: Activity lifecycle problem on Nexus One - onStop not called

2010-03-04 Thread Zuli
Hi Matias,
thanks for your reply, but that's not the point. Because onStop() is
called when the activity is no longer visibile, it should be called
when the user presses the HOME or BACK button, and that is not
happening on the Nexus One... well not on mine at least :)

Zuli


On Mar 4, 8:23 pm, Matias Alberto de la Vega
delavega.mat...@gmail.com wrote:
 Zuli, onStop() is called when your Activity is no longer visible, this
 may happen if a new activity is created (full screen mode) and is
 positioned in front of yours, also it may be caused because another
 Activity is resumed and brought to front (also full screen) and in the
 last case onStop() is called when your Activity is about to be
 destroyed (prior to onDestroy). After onPause() is called there are
 two options, onRestart() is called to restart your Activity or
 onDestroy() is called to kill your activity. Hope this helped. Bye

 On 4 mar, 13:26, Zuli paolo.zuli...@gmail.com wrote:



  Hi,
  I have a problem with the activity lifecycle specifically on Nexus One
  (2.1 running on emulator works fine).
  If I just create a simple empty Activity with no special launchModes
  that logs the calls on the onStart and onStop methods, this is what I
  see:

  - launch app: onStart called;
  - home button: onStop NOT called;
  - launch app: onStart NOT called;
  - home button: onStop NOT called:

  and so on. Sometimes if I press the back button then the onStop is not
  called, but the when i launch the activity again the onStart is called
  and right after the onStop is called.
  Similar results with different launchModes...

  What is going on? Can anyone confirm this?

  Zuli

  i found an android issue for the problem 
  here:http://code.google.com/p/android/issues/detail?id=6094
  and a similar thread 
  herehttp://groups.google.com/group/android-developers/browse_thread/threa...

-- 
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


[android-developers] Re: HTML5 video don't play within a simple WebView

2010-03-03 Thread Zuli
Hi,
you can look at the source code for the web browser for all the
details, but you basically need to override the onShowCustomView
method in your custom WebViewClient and handle yourself the video view
displaying it on top of your layout.

--
Zuli





On 2 Mar, 23:42, gibert.b giber...@gmail.com wrote:
 Hi all,

 First time to me here, great!

 I'm using the official WebView example (http://developer.android.com/
 intl/fr/resources/tutorials/views/hello-webview.html) in order to
 display a mobile website implementing html5 video tags. I'm not able
 to make the videos play through the WebView although I use the custom
 WebViewClient to handle URL requests.

 But, if I test my mobile website over the Android browser, everything
 work!

 Would you please give me some hints?

 Thanks!

-- 
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


[android-developers] Sound engine performance

2009-10-05 Thread Zuli

Hi,
I am working on an app that uses the SoundPool class to play sounds.
Basically every n milliseconds I need to play up to 16 sounds and I
need this to be as steady as possible.
The best solution I found so far is to use a java.util.Timer and the
scheduleAtFixedRate method (setting also a
THREAD_PRIORITY_URGENT_AUDIO in the TimerTask run method), the result
is pretty good but it is still not perfect and sometimes the
executions get slightly delayed.

Is there some other way I should try to play sounds _exactly_ every n
milliseconds? Different threads, some kind of optimization, stuff like
this?

Thanks,
Zuli

ps: I am using .ogg files and there is not much graphic involved in
the computation.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Picasa intent return code

2009-09-24 Thread Zuli

Hi,
I use the standard Picasa upload activity in my application to send
images to the user Picasa account, but everytime the Picasa activity
returns in my onActivityResult function the return code is
RESULT_CANCELED, no matter if I cancel the upload, press the back
button or correctly upload the image, always RESULT_CANCELED,
can someone confirm this?
I need to check if the user correctly started to upload the image...


//Starting the intent
Intent temp=new Intent(Intent.ACTION_SEND);
temp.setType(image/jpeg);
temp.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
temp.putExtra(Intent.EXTRA_STREAM, mImageUri);
temp.setComponent(new ComponentName
(com.google.android.apps.uploader,
com.google.android.apps.uploader.picasa.PicasaUploadActivity));
startActivityForResult(temp, PICASA_INTENT)


//onActivityResult
case PICASA_INTENT:
   //resultCode is always RESULT_CANCELED
   break;

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---