InstrumentationTestCase and startActivityForResult

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


Sponsored Links
 Hi,

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.

Regards,
Dev

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. how to get focus in AlarmClock

Dear all,

I have the same compound layout like AlarmClock, i.e. multiple
"TextView+RadioButton" in a ListView.

But I wish when the user pressing DOWN key or using trackball, the
first focus is in "RadioButton" of first low in ListView (current
behavior the first focus is in TextView).

Can anyone give me a advice on this issue?

Thanks!

--~--~---------~--~----~------------~-------~--~----~

2. Socket problems: broken pipe

Hi all,

I create and open a socket like this:

try {
                socket = new Socket();
                InetSocketAddress addr = new InetSocketAddress(hostName,
port);
                socket.connect(addr);

                dis = new DataInputStream(socket.getInputStream());
                dos = new DataOutputStream(socket.getOutputStream());

        } catch(IOException e) {
                state = PEConnectionStateError;
                Log.d(TAG, "Open failed", e);
                return false;
        }

which succeeds. Later on, I try to write a message to the socket,
which consists of
                super.writeToStream(os); // writes two ints
                os.writeInt(version);
                os.writeInt(flags);
                os.writeUTF(sessionId);
                os.writeUTF(clientId);
                os.writeInt(sequenceId);
                os.writeInt(sequenceHash);

At the writeInt(flags), I get a java.net.SocketException: Broken pipe.
I'm not sure, but I don't think the server ever sees the connection. I
do have  <uses-permission android:name="android.permission.INTERNET" /

Is there some sort of setup I need to do in Eclipse or the emulator to
get this to work? Has anyone else gotten a sockets app working?


--~--~---------~--~----~------------~-------~--~----~

3. Trying to understand LocationListener.

4. Is it possible to launch another app's main activity just by changing manifest.xml?

5. How to copy file from apk raw folder

6. Installing the Eclipse Ganemede Plugin (ADT) for Android

7. MediaScanner connect