Hi Mark -
Yes, thank you for that - ~so~ much better. Call starts, screen
changes.. ooh aah.
However, still some issues -
Right off, PhoneStateListener callback isn't being invoked for one.
Still analyzing the logCat...
Frustrating for me that the API is so coy about what is a Thread, what
OK -
I invoked ACTION_CALL using startActivityForResult(Intent, MY_ID).
I then called finishActivity(MY_ID) - that should have killed the
ACTION_CALL Activity created by the system. However, I can confirm
that it does not.
My next brainwave was to generate a keypress on the hang-up button -
New Approach ...
I have a Hello, World-type program. Basically all I do is say
Hello, World, install a useless button with a button-handler (to
forestall ANR a little), and then I attempt to make a call with the
ACTION_CALL Intent.
I am no longer attempting to start the ACTION_CALL Activity
dreamerBoy wrote:
Uri parsedPhoneNumber = Uri.parse(tel:1234567);
Intent myIntent = new Intent(Intent.ACTION_CALL, parsedPhoneNumber);
Activity myPhoneTestActivity = new Activity();
Don't do that third line. I'm surprised it even works -- I guess
Activity isn't an abstract superclass like I
initiateCall is just an Activity. Activity initiateCall = new
Activity(); (actually a derived class of Activity with nothing added
but debug statements to signal when each lifecycle/callback method is
called).
On Nov 10, 5:37 pm, dreamerBoy [EMAIL PROTECTED] wrote:
Hi - thank you for your
Hmmm... so perhaps I can call wait() or use some other kind of
synchronizer until I get the proper onCreate callback. Thank you very
much for that ... it's a start.
On Nov 10, 5:42 pm, hackbod [EMAIL PROTECTED] wrote:
Probably you are calling this before Activity.onCreate(), which is
where
Sorry... I should have checked my logCat ... in fact onCreate has
already been called at the point where the NullPointerException is
thrown.
On Nov 10, 5:42 pm, hackbod [EMAIL PROTECTED] wrote:
Probably you are calling this before Activity.onCreate(), which is
where the mInstrumentation field
On Nov 10, 6:12 pm, Mark Murphy [EMAIL PROTECTED] wrote:
dreamerBoywrote:
Thanks for the reply, Mark (I recognize the name - I read your book.)
In the ACTION_CALL documentation, it states:
Note: there will be restrictions on which applications can initiate a
call; most applications
Actually, thank you - you WERE correct - onCreate is NOT being called
for this Activity.
I tried doing a wait() for 5 - then 30 seconds on the onCreate
callback being called - the wait timed out... Hmmm how to force
an Activity to properly initialize itself.
On Nov 10, 5:42 pm,
Battle of the quotes, from:
http://code.google.com/android/reference/android/app/Service.html
Other application components running in the same process as the
service (such as an Activity) can, of course, increase the importance
of the overall process beyond just the importance of the service
On Nov 11, 11:35 am, dreamerBoy [EMAIL PROTECTED] wrote:
Actually, thank you - you WERE correct - onCreate is NOT being called
for this Activity.
I tried doing a wait() for 5 - then 30 seconds on the onCreate
callback being called - the wait timed out... Hmmm how to force
an Activity
dreamerBoy wrote:
You could putter through the source code to see how the in-call
application handles it. Again, whatever technique it uses is probably
not for public consumption, your mileage may vary, do not taunt Happy
Fun Android, etc.
I thought that Android was supposed to be about
Thanks for your reply - ha ha, wouldn't that be nice if it were that
simple. Nope, I checked the return from the Uri.parse - not null.
I got a hold of the Android source code. It is crashing here in
Activity.java:
public void startActivityForResult(Intent intent, int
requestCode) {
Taking a hint from the source code, I tried to implement an
Instrumentation class in the hopes that that was what Android was
looking for -
Added:
instrumentation android:targetPackage=test.phone
android:name=.PhoneTestInstrumentation/instrumentation
and
uses-permission
Your log says that the error is in line 254 of PhoneTestService, if
that's a class you wrote.
On Nov 11, 1:20 am, dreamerBoy [EMAIL PROTECTED] wrote:
Taking a hint from the source code, I tried to implement an
Instrumentation class in the hopes that that was what Android was
looking for -
dreamerBoy wrote:
However, same error.
I'm somewhat skeptical that launching an activity, particularly via
startActivityForResult(), will work from a service. I know it's in the
API, but think about what that means: some background process can cause
a full-fledged activity to spawn in front
Hi - thank you for your reply. Yes, line 254 is just:
initiateCall.startActivityForResult(myIntent,
CALL_SETUP_ACTIVITY_ID);
That is the statement that throws the NullPointerException.
On Nov 10, 4:28 pm, Christine [EMAIL PROTECTED] wrote:
Your log says that the error is in line 254
dreamerBoy wrote:
Hi - thank you for your reply. Yes, line 254 is just:
initiateCall.startActivityForResult(myIntent,
CALL_SETUP_ACTIVITY_ID);
What is initiateCall?
--
Mark Murphy (a Commons Guy)
http://commonsware.com
Android Training on the Ranch! -- Mar 16-20, 2009
Probably you are calling this before Activity.onCreate(), which is
where the mInstrumentation field is set.
Note that calling into an activity from a Service like this is pretty
sketchy -- you will need to be very very careful about activity
lifecycle and updating the service as the activity
dreamerBoy wrote:
Thanks for the reply, Mark (I recognize the name - I read your book.)
Thanks!
I am trying to place a call with the Activity that may - but need not,
have any graphical UI aspect to it. Launching an Activity appears to
be the only way to place a call in Android 1.0. If
20 matches
Mail list logo