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 -

      WindowManager wMgr = (WindowManager) getSystemService
(Context.WINDOW_SERVICE);
      KeyEvent keyEvent = new KeyEvent(KeyEvent.ACTION_DOWN,
KeyEvent.KEYCODE_ENDCALL );

However, WindowManager seems to have lost its injectKeyEvent() method
so I'm again... scratching my head.

hackbod was going on about using InstrumentationTestCase to generate
key events but that was for a foreign application - acting as an
outside user so-to-speak.  I only need key presses generated in the
SAME application destined for the SAME application.

Anyway - thanks for the push in the right direction - if you have any
more insights, I thank you in advance...

Paul

On Nov 12, 12:00 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> dreamerBoywrote:
> > 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 would have expected.
>
> > myPhoneTestActivity.startActivityForResult(myIntent,
> > CALL_SETUP_ACTIVITY_ID);  <== Crashes here, NullPointer
>
> Use your already-existing Activity, the one with the button.
>
> > Thus, the ACTION_CALL is now being launched as a sub-Activity.
> > The behavior of this code inside an Activity is the same as it is
> > inside a Service - it crashes at the same place with a
> > NullPointerException (null mInstrumentation).
>
> Correct. myPhoneTestActivity isn't created by the Android framework.
>
> It may be easier to think of Activity as being a plug-in to Android more
> so than a "program" in the traditional sense. Most plug-in frameworks
> don't give you fully-working plugins just by instantiating them.
> Instead, the plugins need to be wired into the overall system, code that
> frequently is done by whoever is launching the plugin itself, outside
> the bounds of the plugin's own constructors or callbacks.
>
> > I'm attempting to launch this new Activity with the ACTION_CALL Intent
> > and Android does not ~appear~ anyway, to know what to do with it.  If
> > that theory is true, then no wonder the Activity is crashing...
>
> I've only tried ACTION_DIAL recently.
>
> However, it seems to work for this person:
>
> http://www.androiddevelopment.org/2008/10/21/android-development-demo...
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
>
> Android Training on the Ranch! -- Mar 16-20, 
> 2009http://www.bignerdranch.com/schedule.shtml
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to