Calling Intent from Two Locations

by Mark Robinton » Sat, 01 Nov 2008 06:27:44 GMT


Sponsored Links
 Hi,

I am trying to call an intent to select someone from the contactlist
from 2 different places in my program.

In one activity class (my main one) I call:

                Intent i=new Intent(Intent.ACTION_PICK,
                Uri.parse("content://contacts/people"));
                startActivityForResult(i, PICK_REQUEST);


and I am able to catch the result of PICK_REQUEST in my
onActivityResult function, no problem.

When I try calling the same intent within another class, it still
tries to catch it in the
onActivityResult of the main class, not in the onActivityResult i
implemented in the 2nd class.

What am I doing wrong so I don't jump out of my other class (where
there's private data I want to access once I am done getting the
contact info).

Thanks,
Mark



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



Calling Intent from Two Locations

by Mark Murphy » Sat, 01 Nov 2008 08:23:38 GMT


 


Is the second class an activity? If not, there's your problem.

If the second class is an activity, I would expect the callback to match 
where startActivityForResult lies. You're not calling 
startActivityForResult in some inner class that gets passed around by 
any chance?

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 1.3 Published!

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


Sponsored Links


Other Threads

1. get the signkey of the apk

Hi all,

I want to get the key (by which the apk signed) of the apk file
installed

how to get the key (by which the apk signed) of apk

need help

Thank you
Dilli



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

2. Decoding <content:encoded>

Hi everyone.
I am writing an XML parser. I want to show the following node but it
is displayed as it is. I want to parse this as well. I need the link
for the images and I need the content without tags. What should I do?
Thanks in advance

<content:encoded>
- <![CDATA[
<p><a href="http://www.androidturkiye.net/wp-content/uploads/2009/03/
always_innovating_touch_book.jpg"><img class="alignleft size-medium wp-
image-647" title="always_innovating_touch_book" src="http://
www.androidturkiye.net/wp-content/uploads/2009/03/always_innovating_touch_book-300x221.jpg"
alt="always_innovating_touch_book" width="300" height="221" /></
a>Bildiiniz gibi Android tabanl netbook Eee PC &#8216; nin piyasaya
ktn sylemitik. u gnlerde, Always Innovating Android&#8217;in
iletim sistemi olarak kullanlabilecei bir dier netbook olan Touch
Book &#8216; un nceden sipari edilebileceini aklad.</p>
<p>Touch Book dokunmatik bir ekran ve karlabilen bir klavyeden
oluuyor. Donanm zelliklerine daha yakndan baktmzda , 8.9-inch
1024 x 600 ekran, 8GB microSD kart, Bluetooth, Wi-Fi 802.11 b/g/n, hz
ler, 6 USB girii, hoparlrler, kulaklk ve mikrofon girii,  10-15
saat aras pil mr gibi zellikleri bulunmaktadr.</p>
<p>Touch Book&#8217;un nceden sipari edilebildii doru; fakat onun
tam olarak Android tabanl netbook olduunu syleyemeyiz. nk SSS
ksmndaki cevaplardan biri u ekilde : &#8221; Google Android,
Ubuntu, Angstrom, ve Windows CE &#8216; yi de ieren istediiniz
herhangi bir iletim sistemini kullanabirsiniz. &#8221; Yine de
Android&#8217; in potansiyel iletim sistemleri arasnda grlmesi
gerekten nemli. Fakat bu Android severlerin dikkatini ekmek iin
yaplm bir aklama da olabilir.</p>
<p>Son olarak, Touch Book&#8217;un haziran 2009 gibi piyasaya kmas
bekleniyor.</p>


  ]]>
  </content:encoded>
--~--~---------~--~----~------------~-------~--~----~

3. Service runs but does not react??

4. SeekBar does not reach the end

5. access parent's protected variable when override a android class

6. maps probelm

7. Kernel build and Apps