Thanks for the pointer Jean-Baptiste.
I'll outline the problem I have at the moment to see if it is a
framework issue or one that's just down to my lack of knowledge.
The AndAppStore client uses a activity which contains a WebView to
display information about a specific application. When the user taps the
download link the activity detects it's a download and runs the
following code;
Intent loadIntent = new Intent
("android.intent.action.VIEW",Uri.parse(url));
loadIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(loadIntent);
This ensures that the .apk is handled by the system apk installer.
Now the issue is that each time a user taps a download link the
startActivity call causes a new browser window to be created, and so if
they download a number of apps the browser eventually reports that too
many windows are open.
Now what I'd suggest is that some mechanism is introduced to allow
activities to re-use a browser window. From a developers point of view I
would suggest that setting the flag ACTIVITY_CLEAR_TOP should re-use the
last browser window created for the calling activity or create a new one
if a windows has not yet been created for that activity.
But I'm guessing this may not be the best approach from a framework
point of view....
Al.
Jean-Baptiste Queru wrote:
> That's an area where improvements are known to be necessary. If you
> have some precise ideas, feel free to head over to the
> android-framework list where we discuss specific changes to the
> android source code that are visible at the level of applications
> built on top of the SDK.
>
> JBQ
>
> On Thu, Dec 11, 2008 at 12:30 AM, Al Sutton <[EMAIL PROTECTED]> wrote:
>
>> The problem I can see with this is eventually the browser presents a
>> "Too many windows" error message to the user.
>>
>> Are there plans to update the browser to allow window reuse, or is this
>> another "It's like that and that's the way it is" situation?
>>
>> Al.
>>
>> Dianne Hackborn wrote:
>>
>>> There is probably nothing you can do about this at your point, as far
>>> as I know. This is all done inside of the browser -- the browser is
>>> one single activity, and all of the "windows" and page management is
>>> done within that activity. It just happens to decide, each time that
>>> activity receives a new intent, to create a new "window" for it.
>>>
>>> On Wed, Dec 10, 2008 at 5:10 PM, Mark Murphy <[EMAIL PROTECTED]
>>> <mailto:[EMAIL PROTECTED]>> wrote:
>>>
>>>
>>> In an app, I am launching the built-in Browser activity via:
>>>
>>> startActivity(new Intent(Intent.ACTION_VIEW,
>>> Uri.parse("http://www.google.com")));
>>>
>>> The first time you do this, it starts another "window". This
>>> doesn't
>>> faze me.
>>>
>>> However, if you back-arrow out of the browser back into my
>>> application,
>>> and trigger startActivity() again, it creates a third window.
>>> Back-arrow
>>> and trigger startActivity() again, it creates a fourth window. And
>>> so on.
>>>
>>> I don't mind adding one more window to the Browser, but adding
>>> one per
>>> startActivity() call seems evil.
>>>
>>> My guess is that I need to use a FLAG_ACTIVITY_*, or combination of
>>> same, with my Intent to stop this behavior. However, I've tried
>>> a few,
>>> and nothing has worked.
>>>
>>> Any thoughts?
>>>
>>> Thanks in advance!
>>>
>>> --
>>> Mark Murphy (a Commons Guy)
>>> http://commonsware.com
>>> _The Busy Coder's Guide to Android Development_ Version 1.9
>>> Available!
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Dianne Hackborn
>>> Android framework engineer
>>> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>>>
>>> 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.
>>>
>>>
>>>
>> --
>> ======
>> Funky Android Limited is registered in England & Wales with the
>> company number 6741909. The registered head office is Kemp House,
>> 152-160 City Road, London, EC1V 2NX, UK.
>>
>> The views expressed in this email are those of the author and not
>> necessarily those of Funky Android Limited, it's associates, or it's
>> subsidiaries.
>>
>>
>>
>
> >
>
--
======
Funky Android Limited is registered in England & Wales with the
company number 6741909. The registered head office is Kemp House,
152-160 City Road, London, EC1V 2NX, UK.
The views expressed in this email are those of the author and not
necessarily those of Funky Android Limited, it's associates, or it's
subsidiaries.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"android-framework" 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-framework?hl=en
-~----------~----~----~----~------~----~------~--~---