[android-developers] Re: Return to my application when back key is pressed from native dialer

2010-11-05 Thread ar
Sorry for not being very clear.

Yes, by native homescreen I mean the same as when user presses home
button.

I don't see a difference in behavior between using ACTION_VIEW AND
ACTION_DIAL wrt to the back key press behavior - I still am taken back
to native homescreen instead of my app (when I press the back key from
native dialer)

There difference with using ACTION_VIEW with a number and ACTION_VIEW
without a number. The difference being, in the second case  I get
taken to the native dialer overlayed by the dialog asking me to
'Complete action using'.

I'm testing on Nexus one and HTC incredible.



On Nov 4, 8:14 pm, Frank Weiss fewe...@gmail.com wrote:
 I'm not following you very well. I assume you mean that if you add the phone
 number, then the back button does take the user back to your activity, but
 without the phone number, the back button takes the user to the home screen.
 I also assume that what you mean by native homescreen is the same as when
 the user presses the home bvutton on the phone.

 If that's the case, I think you should expalan your use case better. If the
 dialer behavior for the back button is different when a phone number is
 provided or not, that might by an Android OS issue, or an issue in your use
 case.

 I also don't understand you're introducing a possible issue with using a
 dialog. AFAIK, you would have to call startActivity(Intent) in the activity,
 after the dialog has been closed.

 You also have not indicated what phone and API level you are having this
 issue on. But perhaps if my assumption is correct, you can get the back
 button to work correctly if you supply the dialer with a phone number?

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Return to my application when back key is pressed from native dialer

2010-11-05 Thread Frank Weiss
Thanks for clearing up some of those questions.

I have some hypothesis at this point. First, is your activity calling finish
somewhere? That would explain why it's not there when the user presses back
in the dialer. Have you tried a breakpoint in the activity's onResume
method? Perhaps it is being called after the back button, but is doing
something weird. The other is perhaps there's a launch flag in your activity
that causes it to be removed from the activity stack once the dialer
activity is started.

hth

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Return to my application when back key is pressed from native dialer

2010-11-05 Thread ar
Thanks! That was exactly the problem.

I was calling finish in the onPause method


On Nov 5, 11:49 am, Frank Weiss fewe...@gmail.com wrote:
 Thanks for clearing up some of those questions.

 I have some hypothesis at this point. First, is your activity calling finish
 somewhere? That would explain why it's not there when the user presses back
 in the dialer. Have you tried a breakpoint in the activity's onResume
 method? Perhaps it is being called after the back button, but is doing
 something weird. The other is perhaps there's a launch flag in your activity
 that causes it to be removed from the activity stack once the dialer
 activity is started.

 hth

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Return to my application when back key is pressed from native dialer

2010-11-05 Thread Frank Weiss
Woo hoo! After a week of struggles at my day job, it's gratifying to hear a
success story.

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Return to my application when back key is pressed from native dialer

2010-11-04 Thread ar
This is the code I use to start the dialer activity from my activity

Intent dialIntent = new Intent(Intent.ACTION_DIAL);
startActivity(dialIntent);



On Nov 4, 1:30 pm, TreKing treking...@gmail.com wrote:
 On Thu, Nov 4, 2010 at 1:57 PM, ar anitaa...@gmail.com wrote:
  b) The user is taken to the native dialer when he chooses a particular
  action in my Activity
  c) User presses the back key
  d) Taken to homescreen

 That doesn't sound right - you should be going back to your activity, which
 is what was previously shown. How are you starting the dialer activity?

 ---­--
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Return to my application when back key is pressed from native dialer

2010-11-04 Thread Frank Weiss
The behavior of the code you posted should be to return to your activity
when the user finished the dialer activity by pressing back. What behavior
did you observe?

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Return to my application when back key is pressed from native dialer

2010-11-04 Thread ar

That's not what I see. The user is taken to native homescreen when he
presses the back key.


On Nov 4, 3:13 pm, Frank Weiss fewe...@gmail.com wrote:
 The behavior of the code you posted should be to return to your activity
 when the user finished the dialer activity by pressing back. What behavior
 did you observe?

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Return to my application when back key is pressed from native dialer

2010-11-04 Thread Frank Weiss
I'll have to check the code I use. But perhaps the problem is you're not
giving a number or try using Intent.ACTION_VIEW instead of
Intent.ACTION_DIAL.

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Return to my application when back key is pressed from native dialer

2010-11-04 Thread ar

That doesn't work. If I change my code to use Intent.ACTION_VIEW, I
get taken to the native dialer overlayed by the dialog asking me to
'Complete action using'.

On Nov 4, 3:49 pm, Frank Weiss fewe...@gmail.com wrote:
 I'll have to check the code I use. But perhaps the problem is you're not
 giving a number or try using Intent.ACTION_VIEW instead of
 Intent.ACTION_DIAL.

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Return to my application when back key is pressed from native dialer

2010-11-04 Thread Frank Weiss
This works for me on the Droid:


String phoneUri = tel: + phone.getText();

Intent i = *new* Intent(Intent.*ACTION_VIEW*, Uri.*parse*(phoneUri));

startActivity(i);

What phone did you use? Have you tried adding a phone number?

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Return to my application when back key is pressed from native dialer

2010-11-04 Thread Frank Weiss
I'm not following you very well. I assume you mean that if you add the phone
number, then the back button does take the user back to your activity, but
without the phone number, the back button takes the user to the home screen.
I also assume that what you mean by native homescreen is the same as when
the user presses the home bvutton on the phone.

If that's the case, I think you should expalan your use case better. If the
dialer behavior for the back button is different when a phone number is
provided or not, that might by an Android OS issue, or an issue in your use
case.

I also don't understand you're introducing a possible issue with using a
dialog. AFAIK, you would have to call startActivity(Intent) in the activity,
after the dialog has been closed.

You also have not indicated what phone and API level you are having this
issue on. But perhaps if my assumption is correct, you can get the back
button to work correctly if you supply the dialer with a phone number?

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Return to my application when back key is pressed from native dialer

2010-11-04 Thread ar
Yes, it works if I add a phone number. However, it doesn't solve my
problem of going back to my app when I press the back key. It still
goes back to the native homescreen.

I have a dialog in my activity, from which the user action is taking
them to the native dialer. Is that the reason back doesn't bring them
back to my app (since the dialog has already been dismissed)?



On Nov 4, 6:13 pm, Frank Weiss fewe...@gmail.com wrote:
 This works for me on the Droid:

 String phoneUri = tel: + phone.getText();

 Intent i = *new* Intent(Intent.*ACTION_VIEW*, Uri.*parse*(phoneUri));

 startActivity(i);

 What phone did you use? Have you tried adding a phone number?

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en