InstrumentationTestCase and startActivityForResult

by dev » Thu, 06 Aug 2009 23:18:03 GMT

Sponsored Links

Can a InstrumenatationTestCase class call startActivityForResult ? and
have onActivityResult for getting its result.

I tried the same in an Activity , that works.

But from an Instrumentation class I can call only startActivity

I need to get some result from Activity to instrumentation.
How do I go about it?

Any input would be of great help.



Other Threads

1. Zealots (WAS Unacceptable and abusive comments needs immediate solution from Google)

Since I suspect that's aimed in my general direction, let me be clear:

Google developers can "make bugs". Considering how many they have
pointed out on these lists, I suspect they'd be the first to tell you
that they "make bugs".

You have reported several bugs on these lists. As I recall, for these,
you indicated, in no uncertain terms, that if they affected you, they
must affect everyone, and that they are clearly bugs in Android proper
with no other possible cause.

I don't recall in any of those situations questioning whether the
symptoms were real. I asked for more evidence on the claims that they
affect everyone, that they were unequivocally bugs in Android proper,
plus for ways to reproduce the problems. The latter is the most
important, because no matter how the symptoms are caused, without
reproducible scenarios, fixing them is well nigh impossible.

In some cases (e.g., force-close-after-update), such evidence has
arrived, at least on the first two points. If we're lucky, the same
thing that causes this problem is what causes the similar force-close
triggered by changes to the AndroidManifest.xml file, that somebody
reported, I reproduced, and I opened an issue for. I doubt they're the
same thing, but one can only hope, since reproducing
force-close-after-update is obviously difficult.

In some cases (e.g., "TERRIBLE BUG"), evidence definitely points to a
bug in the build tools, though no evidence has arrived that indicates it
is currently affecting every Android developer. And, IIRC, we still
don't have a reproducible test case.

In some cases (e.g., takes-15-seconds-to-pick-up), we have neither
evidence of a widespread phenomenon nor conclusive evidence of a purely
OS problem. In this specific case, I'm still backing my theory that it's
out-of-spec hardware that is reacting poorly with a new driver in RC33.
Heck, if I were HTC, I'd buy your phone off of you, just to have a
sample of the problem on hand. Alas, I am not HTC, nor do I play HTC on TV.

If I'm a zealot for asking for evidence to back up sweeping claims and
broad generalizations, and for hoping for more civil discourse than
sometimes is seen on these lists, then I'm comfortable with that.

Mark Murphy (a Commons Guy) |

Android App Developer Books:


2. Problem init a custom made Daemon in Android

I ported CUPSD to Android but have some problem initializing cupsd by
manually typing cupsd & in terminal. Cupsd alawys exits with error. I
haven't tried to start cupsd by adding service in init,rc due to some
technical difficulty. So just not sure is it  wrong to start a daemon
manually? Can somebody explains the difference of initing service from
within init.rc and initing service manually. Thanks.

3. Cupcake wont start in emulator

4. android.permission.GET_ACCOUNTS

5. RESTful Single Sign on shown on the iPhon

6. Animation on a view doesn't 'stick' in reality

7. list of request codes - their names and values?