And... I spoke too soon.
When I exported the application and installed it on the device, it goes
back to the wonky launch behavior...
E
On Wednesday, November 7, 2012 2:54:44 PM UTC-5, Evan Ruff wrote:
>
> So I found an edge case where I was calling finish() on my Launcher
> activity. This was causing the behavior I described above.
>
> I'm still not sure why it's different for the emulator and for the actual
> running, but preliminary testing has indicated that it solves the issue...
> so far so good, will report back with findings if anything changes.
>
> E
>
> On Wednesday, November 7, 2012 2:12:08 PM UTC-5, Evan Ruff wrote:
>>
>> Hey Kostya,
>>
>> Thanks for the reply.
>>
>> What are the differences in these flag?
>>
>> Do you have any insight into how to make the production app perform the
>> same Home <> Launcher behvior as when it's production?
>>
>> Thanks,
>>
>> E
>>
>> On Wednesday, November 7, 2012 1:47:09 PM UTC-5, Kostya Vasilyev wrote:
>>>
>>> Evan,
>>>
>>> Eclipse uses a slightly different intent when launching your app than
>>> the Launcher does. The following are log lines from my current project.
>>>
>>> Launcher:
>>>
>>> 11-07 22:39:50.309 I/AccountListActivity(25660): ***** onCreate: Intent
>>> { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
>>> flg=0x10200000 cmp=org.kman.AquaMail/.ui.AccountListActivity
>>> bnds=[520,585][680,785] }
>>>
>>> Starting a debug session from Eclipse:
>>>
>>> 11-07 22:40:33.543 I/AccountListActivity(27935): ***** onCreate: Intent
>>> { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
>>> flg=0x10000000 cmp=org.kman.AquaMail/.ui.AccountListActivity }
>>>
>>> Note the difference in flags: 0x10200000 vs 0x10000000.
>>>
>>> To work around, you could press back to finish your top activity
>>> immediately after launching from Eclipse, then go back into the app from
>>> Launcher. This will keep your debug session intact: the debugger will still
>>> be attached, the breakpoints set.
>>>
>>> -- K
>>>
>>> 2012/11/7 Evan Ruff <[email protected]>
>>>
>>>> Hello all,
>>>>
>>>> I'm having some very frustrating and confusing issues getting my
>>>> application to function as it has been. My application uses an Application
>>>> object to hold a user object. This object is large and is loaded from the
>>>> database and held in the Application singleton (MyApplication extends
>>>> Application) by an async task in my .Splash activity. All activities
>>>> subclass a BaseActivity that checks for the existence of this user. If the
>>>> user is not present, it finish()es the activity and finishes all the way
>>>> back to the Splash screen, where the user is loaded from the DB.
>>>>
>>>> The splash activity looks like this:
>>>> <activity
>>>> android:name=".Splash"
>>>> android:label="@string/app_name"
>>>> android:screenOrientation="portrait" >
>>>> <intent-filter>
>>>> <action android:name="android.intent.action.MAIN" />
>>>>
>>>> <category
>>>> android:name="android.intent.category.LAUNCHER" />
>>>> </intent-filter>
>>>> </activity>
>>>>
>>>> This application has been deployed in various forms all the way since
>>>> 1.5. In the past, let's say you were working in the application on an
>>>> Activity four down the stack. You hit home/phone call/whatever and, when
>>>> the application returns, the onResume activity picks up the user from the
>>>> Application and everything works as normal. I am not getting this behavior
>>>> anymore. On my MyTouch running 1.6, it works as expected. Whatever
>>>> Activity
>>>> was previously on top of the stack is loaded and onResume called.
>>>>
>>>> All of a sudden, I am not seeing that behavior.
>>>>
>>>> On my Galaxy Nexus, it does not work as expected. On the GNexus, if I
>>>> hit HOME then hit the Launcher icon, sometimes, the Application is
>>>> clobbered and the fall through happens. Other times, it goes right back to
>>>> the launcher .Splash activity. If I hit HOME, then hit the recent apps, it
>>>> works fine. Looking at LogCat output, it doesn't seem to try to resume at
>>>> all if I hit the Launcher button. I have tried launchMode=singleTop, but
>>>> that doesn't seem to work.
>>>>
>>>> And here's even the crazier part... if I deploy the application from
>>>> the debugger over ADB... WITHOUT ANY CODE CHANGES, I get the behavior I'm
>>>> expecting and have gotten in the past. The last activity pops up as usual,
>>>> onResume executed and the application can find the Application. This holds
>>>> true even if I disconnect the debugger, restart the phone, and just use
>>>> the
>>>> application that way. The problem occurs when I compile, deploy and
>>>> install
>>>> the APK directly.
>>>>
>>>> I'm quite baffled by this behavior. Has anyone else had this sort of
>>>> scenario?
>>>>
>>>> I'd appreciate any help anyone could provide.
>>>>
>>>> Thanks!
>>>>
>>>> Evan
>>>>
>>>> --
>>>> 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