[android-developers] Re: Problem Starting New Activity

2009-04-09 Thread Dianne Hackborn
You can't currently replace the in-call experience.

On Thu, Apr 9, 2009 at 6:58 AM, Marc Poppleton wrote:

>
> Hi,
>
> Where is the PHONE_STATE_CHANGED Intent defined? I can't find it
> anywhere in the documentation and am in a situation similar to Bnet's.
> I'm trying to get my Activity to pop-up when an incoming call occurs,
> I don't like the default view and want my own instead (I wish to
> display extra data about the callee than currently displayed).
>
> Thanks,
>
> Marc
>
> On 3 mar, 20:25, Marco Nelissen  wrote:
> > On Tue, Mar 3, 2009 at 9:09 AM, Bnet  wrote:
> >
> > > I'm trying to call the SoundNotification.java from the
> > >PhoneStateListenerto test a default system notification sound. When a
> > > missed call state is true, the SoundNotification.java is called to
> > > play the sound or beep. I understand your point about the receiver
> > > dropping thephonestatelistenerand appreciate the feedback. Thanks
> > > again.
> >
> > OK, so it sounds like *what* you want to do (your MyPhoneStateListener
> > and SoundNotification classes are part of *how* you want to do it) is
> > to play a sound when a call is missed.
> > So first you need to figure out if a call is missed. There are a
> > number of ways to do that. You were trying to do this by using
> aPhoneStateListener, which is fine, but I don't think you actually need
> > it. You already have a receiver for the PHONE_STATE_CHANGED Intent
> > broadcast, and that Intent already contains an 'extra' that tells you
> > the current state, so you shouldn't need to set up aPhoneStateListener.
> > Then, since you're determining whether a call was missed by
> > idle-ringing-idle transitions, you'll need some place to store the
> > intermediate states, so that when the call state goes to idle again,
> > you can check whether the previous state was offhook, and if not, play
> > the sound.
> > You could use a Service to keep track of the intermediate states, but
> > a simpler solution might be to store/retrieve the previous state using
> > a SharedPreference. However you want to do it is up to you, but you
> > shouldn't rely on the broadcast receiver itself keeping any state for
> > you. Once you've determined that a call was missed, you play the
> > sound, probably using MediaPlayer.
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-04-09 Thread Marc Poppleton

Hi,

Where is the PHONE_STATE_CHANGED Intent defined? I can't find it
anywhere in the documentation and am in a situation similar to Bnet's.
I'm trying to get my Activity to pop-up when an incoming call occurs,
I don't like the default view and want my own instead (I wish to
display extra data about the callee than currently displayed).

Thanks,

Marc

On 3 mar, 20:25, Marco Nelissen  wrote:
> On Tue, Mar 3, 2009 at 9:09 AM, Bnet  wrote:
>
> > I'm trying to call the SoundNotification.java from the
> >PhoneStateListenerto test a default system notification sound. When a
> > missed call state is true, the SoundNotification.java is called to
> > play the sound or beep. I understand your point about the receiver
> > dropping thephonestatelistenerand appreciate the feedback. Thanks
> > again.
>
> OK, so it sounds like *what* you want to do (your MyPhoneStateListener
> and SoundNotification classes are part of *how* you want to do it) is
> to play a sound when a call is missed.
> So first you need to figure out if a call is missed. There are a
> number of ways to do that. You were trying to do this by using 
> aPhoneStateListener, which is fine, but I don't think you actually need
> it. You already have a receiver for the PHONE_STATE_CHANGED Intent
> broadcast, and that Intent already contains an 'extra' that tells you
> the current state, so you shouldn't need to set up aPhoneStateListener.
> Then, since you're determining whether a call was missed by
> idle-ringing-idle transitions, you'll need some place to store the
> intermediate states, so that when the call state goes to idle again,
> you can check whether the previous state was offhook, and if not, play
> the sound.
> You could use a Service to keep track of the intermediate states, but
> a simpler solution might be to store/retrieve the previous state using
> a SharedPreference. However you want to do it is up to you, but you
> shouldn't rely on the broadcast receiver itself keeping any state for
> you. Once you've determined that a call was missed, you play the
> sound, probably using MediaPlayer.

--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-03 Thread Marco Nelissen

On Tue, Mar 3, 2009 at 9:09 AM, Bnet  wrote:
>
> I'm trying to call the SoundNotification.java from the
> PhoneStateListener to test a default system notification sound. When a
> missed call state is true, the SoundNotification.java is called to
> play the sound or beep. I understand your point about the receiver
> dropping the phonestatelistener and appreciate the feedback. Thanks
> again.

OK, so it sounds like *what* you want to do (your MyPhoneStateListener
and SoundNotification classes are part of *how* you want to do it) is
to play a sound when a call is missed.
So first you need to figure out if a call is missed. There are a
number of ways to do that. You were trying to do this by using a
PhoneStateListener, which is fine, but I don't think you actually need
it. You already have a receiver for the PHONE_STATE_CHANGED Intent
broadcast, and that Intent already contains an 'extra' that tells you
the current state, so you shouldn't need to set up a
PhoneStateListener.
Then, since you're determining whether a call was missed by
idle-ringing-idle transitions, you'll need some place to store the
intermediate states, so that when the call state goes to idle again,
you can check whether the previous state was offhook, and if not, play
the sound.
You could use a Service to keep track of the intermediate states, but
a simpler solution might be to store/retrieve the previous state using
a SharedPreference. However you want to do it is up to you, but you
shouldn't rely on the broadcast receiver itself keeping any state for
you. Once you've determined that a call was missed, you play the
sound, probably using MediaPlayer.

--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-03 Thread Bnet

I'm trying to call the SoundNotification.java from the
PhoneStateListener to test a default system notification sound. When a
missed call state is true, the SoundNotification.java is called to
play the sound or beep. I understand your point about the receiver
dropping the phonestatelistener and appreciate the feedback. Thanks
again.

On Mar 3, 10:50 am, Marco Nelissen  wrote:
> On Mon, Mar 2, 2009 at 4:36 PM, Bnet  wrote:
>
> > Okay Thanks. In regards to having a Context to call startActivity(),
> > does it make sense to move the SoundNotification to the
> > ServiceReceiver as shown below? I can't seem to basically call a
> > subroutine.
>
> > public class ServiceReceiver extends BroadcastReceiver {
>
> >       �...@override
> >        public void onReceive(Context context, Intent intent) {
>
> >                MyPhoneStateListener phoneListener=new 
> > MyPhoneStateListener();
> >        TelephonyManager telephony = (TelephonyManager)
> > context.getSystemService(Context.TELEPHONY_SERVICE);
> >        telephony.listen
> > (phoneListener,PhoneStateListener.LISTEN_CALL_STATE);
>
> >        Intent i = new Intent
> > ("com.bnet.detectmissedcall.SoundNotification");
> >        context.startActivity(i);
>
> >    }
> > }
>
> I'm not sure what you're trying to do there. You're still creating
> your PhoneStateListener locally in your Receiver, which is not a good
> idea.
> It might help if you tell us what you're actually trying to do.- Hide quoted 
> text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-03 Thread Marco Nelissen

On Mon, Mar 2, 2009 at 4:36 PM, Bnet  wrote:
>
> Okay Thanks. In regards to having a Context to call startActivity(),
> does it make sense to move the SoundNotification to the
> ServiceReceiver as shown below? I can't seem to basically call a
> subroutine.
>
> public class ServiceReceiver extends BroadcastReceiver {
>
>       �...@override
>        public void onReceive(Context context, Intent intent) {
>
>                MyPhoneStateListener phoneListener=new MyPhoneStateListener();
>        TelephonyManager telephony = (TelephonyManager)
> context.getSystemService(Context.TELEPHONY_SERVICE);
>        telephony.listen
> (phoneListener,PhoneStateListener.LISTEN_CALL_STATE);
>
>
>        Intent i = new Intent
> ("com.bnet.detectmissedcall.SoundNotification");
>        context.startActivity(i);
>
>
>    }
> }

I'm not sure what you're trying to do there. You're still creating
your PhoneStateListener locally in your Receiver, which is not a good
idea.
It might help if you tell us what you're actually trying to do.

--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-03 Thread Bnet


Can the SoundNotificaton be called from either the Receiver or the
PhoneStateListener?
On Mar 2, 6:36 pm, Bnet  wrote:
> Okay Thanks. In regards to having a Context to call startActivity(),
> does it make sense to move the SoundNotification to the
> ServiceReceiver as shown below? I can't seem to basically call a
> subroutine.
>
> public class ServiceReceiver extends BroadcastReceiver {
>
>         @Override
>         public void onReceive(Context context, Intent intent) {
>
>                 MyPhoneStateListener phoneListener=new MyPhoneStateListener();
>         TelephonyManager telephony = (TelephonyManager)
> context.getSystemService(Context.TELEPHONY_SERVICE);
>         telephony.listen
> (phoneListener,PhoneStateListener.LISTEN_CALL_STATE);
>
>         Intent i = new Intent
> ("com.bnet.detectmissedcall.SoundNotification");
>         context.startActivity(i);
>
>     }
>
> }
>
> -
>
> public class SoundNotification extends Activity
> {
>
>         private static final int NOTIFY_ME_ID=1337;
>         private Timer timer=new Timer();
>
>         @Override
>         public void onCreate(Bundle savedInstanceState)
>         {
>                 super.onCreate(savedInstanceState);
>
>                                 TimerTask task=new TimerTask()
>                                 {
>                                         public void run()
>                                         {
>                                                 notifyMe();
>                                         }
>                                 };
>                                 timer.schedule(task, 5000);
>           }
>
>         private void notifyMe()
>         {
>                 final NotificationManager
> mgr=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
>
>                 Notification note=new Notification(R.drawable.icon,
> "Status message!", System.currentTimeMillis());
>
>                 note.vibrate = new long[] { 100,200,150, 500 };
>
>                                 note.defaults = Notification.DEFAULT_ALL;
>
>                                 PendingIntent 
> i=PendingIntent.getActivity(this,
> 0,
>                                                 new Intent(this,
> SoundNotification.class), 0);
>
>                                note.setLatestEventInfo(this, "Notification
> Title", "This is the notification message", i);
>
>                                 mgr.notify(NOTIFY_ME_ID, note);
>
>         }
>
> }
>
> On Mar 2, 2:17 pm, Marco Nelissen  wrote:
>
>
>
> > That won't work, because your PhoneStateListener is going to disappear
> > as soon as (or shortly after) you return from onReceive().
> > You should have your receiver start a Service that hosts the 
> > PhoneStateListener.
>
> > On Mon, Mar 2, 2009 at 12:03 PM, Bnet  wrote:
>
> > > Following is the receiver
>
> > > import android.content.BroadcastReceiver;
> > > import android.content.Context;
> > > import android.content.Intent;
> > > import android.telephony.PhoneStateListener;
> > > import android.telephony.TelephonyManager;
>
> > > public class ServiceReceiver extends BroadcastReceiver {
>
> > >       �...@override
> > >        public void onReceive(Context context, Intent intent) {
> > >                MyPhoneStateListener phoneListener=new 
> > > MyPhoneStateListener();
> > >        TelephonyManager telephony = (TelephonyManager)
> > > context.getSystemService(Context.TELEPHONY_SERVICE);
> > >        telephony.listen
> > > (phoneListener,PhoneStateListener.LISTEN_CALL_STATE);
>
> > >    }
> > > }
>
> > > On Mar 2, 1:55 pm, Marco Nelissen  wrote:
> > >> On Mon, Mar 2, 2009 at 11:49 AM, Bnet  wrote:
>
> > >> > Thanks for your time Marco, added the following to the manifest. There
> > >> > is an error in MyPhoneStateListener as shown below:
>
> > >> >         
> > >> >                
> > >> >                 > >> > android:name="android.intent.action.SoundNotification" />
>
> > >> You should use the same string here that you use for the intent
> > >> action, i.e. "com.bnet.detectmissedcall.SoundNotification"
>
> > >> >                
> > >> >         
>
> > >> > Error: The method startActivity(Intent) is undefined for the type
> > >> > MyPhoneStateListener
>
> > >> > Intent i = new Intent("com.bnet.detectmissedcall.SoundNotification");
> > >> > startActivity(i);
>
> > >> You will need to have a Context to call startActivity() on. It's not
> > >> clear to me how you create your PhoneStateListener, but the Activity
> > >> or Service that you create it in should have a Context for you to use.- 
> > >> Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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 

[android-developers] Re: Problem Starting New Activity

2009-03-02 Thread Bnet

Okay Thanks. In regards to having a Context to call startActivity(),
does it make sense to move the SoundNotification to the
ServiceReceiver as shown below? I can't seem to basically call a
subroutine.

public class ServiceReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {

MyPhoneStateListener phoneListener=new MyPhoneStateListener();
TelephonyManager telephony = (TelephonyManager)
context.getSystemService(Context.TELEPHONY_SERVICE);
telephony.listen
(phoneListener,PhoneStateListener.LISTEN_CALL_STATE);


Intent i = new Intent
("com.bnet.detectmissedcall.SoundNotification");
context.startActivity(i);


}
}


-

public class SoundNotification extends Activity
{

private static final int NOTIFY_ME_ID=1337;
private Timer timer=new Timer();


@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);



TimerTask task=new TimerTask()
{
public void run()
{
notifyMe();
}
};
timer.schedule(task, 5000);
  }





private void notifyMe()
{
final NotificationManager
mgr=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);


Notification note=new Notification(R.drawable.icon,
"Status message!", System.currentTimeMillis());


note.vibrate = new long[] { 100,200,150, 500 };


note.defaults = Notification.DEFAULT_ALL;


PendingIntent i=PendingIntent.getActivity(this,
0,
new Intent(this,
SoundNotification.class), 0);


   note.setLatestEventInfo(this, "Notification
Title", "This is the notification message", i);

mgr.notify(NOTIFY_ME_ID, note);




}
}

On Mar 2, 2:17 pm, Marco Nelissen  wrote:
> That won't work, because your PhoneStateListener is going to disappear
> as soon as (or shortly after) you return from onReceive().
> You should have your receiver start a Service that hosts the 
> PhoneStateListener.
>
>
>
> On Mon, Mar 2, 2009 at 12:03 PM, Bnet  wrote:
>
> > Following is the receiver
>
> > import android.content.BroadcastReceiver;
> > import android.content.Context;
> > import android.content.Intent;
> > import android.telephony.PhoneStateListener;
> > import android.telephony.TelephonyManager;
>
> > public class ServiceReceiver extends BroadcastReceiver {
>
> >       �...@override
> >        public void onReceive(Context context, Intent intent) {
> >                MyPhoneStateListener phoneListener=new 
> > MyPhoneStateListener();
> >        TelephonyManager telephony = (TelephonyManager)
> > context.getSystemService(Context.TELEPHONY_SERVICE);
> >        telephony.listen
> > (phoneListener,PhoneStateListener.LISTEN_CALL_STATE);
>
> >    }
> > }
>
> > On Mar 2, 1:55 pm, Marco Nelissen  wrote:
> >> On Mon, Mar 2, 2009 at 11:49 AM, Bnet  wrote:
>
> >> > Thanks for your time Marco, added the following to the manifest. There
> >> > is an error in MyPhoneStateListener as shown below:
>
> >> >         
> >> >                
> >> >                 >> > android:name="android.intent.action.SoundNotification" />
>
> >> You should use the same string here that you use for the intent
> >> action, i.e. "com.bnet.detectmissedcall.SoundNotification"
>
> >> >                
> >> >         
>
> >> > Error: The method startActivity(Intent) is undefined for the type
> >> > MyPhoneStateListener
>
> >> > Intent i = new Intent("com.bnet.detectmissedcall.SoundNotification");
> >> > startActivity(i);
>
> >> You will need to have a Context to call startActivity() on. It's not
> >> clear to me how you create your PhoneStateListener, but the Activity
> >> or Service that you create it in should have a Context for you to use.- 
> >> Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-02 Thread Marco Nelissen

That won't work, because your PhoneStateListener is going to disappear
as soon as (or shortly after) you return from onReceive().
You should have your receiver start a Service that hosts the PhoneStateListener.



On Mon, Mar 2, 2009 at 12:03 PM, Bnet  wrote:
>
> Following is the receiver
>
>
> import android.content.BroadcastReceiver;
> import android.content.Context;
> import android.content.Intent;
> import android.telephony.PhoneStateListener;
> import android.telephony.TelephonyManager;
>
>
> public class ServiceReceiver extends BroadcastReceiver {
>
>       �...@override
>        public void onReceive(Context context, Intent intent) {
>                MyPhoneStateListener phoneListener=new MyPhoneStateListener();
>        TelephonyManager telephony = (TelephonyManager)
> context.getSystemService(Context.TELEPHONY_SERVICE);
>        telephony.listen
> (phoneListener,PhoneStateListener.LISTEN_CALL_STATE);
>
>
>
>
>    }
> }
>
> On Mar 2, 1:55 pm, Marco Nelissen  wrote:
>> On Mon, Mar 2, 2009 at 11:49 AM, Bnet  wrote:
>>
>> > Thanks for your time Marco, added the following to the manifest. There
>> > is an error in MyPhoneStateListener as shown below:
>>
>> >         
>> >                
>> >                > > android:name="android.intent.action.SoundNotification" />
>>
>> You should use the same string here that you use for the intent
>> action, i.e. "com.bnet.detectmissedcall.SoundNotification"
>>
>> >                
>> >         
>>
>> > Error: The method startActivity(Intent) is undefined for the type
>> > MyPhoneStateListener
>>
>> > Intent i = new Intent("com.bnet.detectmissedcall.SoundNotification");
>> > startActivity(i);
>>
>> You will need to have a Context to call startActivity() on. It's not
>> clear to me how you create your PhoneStateListener, but the Activity
>> or Service that you create it in should have a Context for you to use.
> >
>

--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-02 Thread Bnet

Following is the receiver


import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;


public class ServiceReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
MyPhoneStateListener phoneListener=new MyPhoneStateListener();
TelephonyManager telephony = (TelephonyManager)
context.getSystemService(Context.TELEPHONY_SERVICE);
telephony.listen
(phoneListener,PhoneStateListener.LISTEN_CALL_STATE);




}
}

On Mar 2, 1:55 pm, Marco Nelissen  wrote:
> On Mon, Mar 2, 2009 at 11:49 AM, Bnet  wrote:
>
> > Thanks for your time Marco, added the following to the manifest. There
> > is an error in MyPhoneStateListener as shown below:
>
> >         
> >                
> >                 > android:name="android.intent.action.SoundNotification" />
>
> You should use the same string here that you use for the intent
> action, i.e. "com.bnet.detectmissedcall.SoundNotification"
>
> >                
> >         
>
> > Error: The method startActivity(Intent) is undefined for the type
> > MyPhoneStateListener
>
> > Intent i = new Intent("com.bnet.detectmissedcall.SoundNotification");
> > startActivity(i);
>
> You will need to have a Context to call startActivity() on. It's not
> clear to me how you create your PhoneStateListener, but the Activity
> or Service that you create it in should have a Context for you to use.
--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-02 Thread Marco Nelissen

On Mon, Mar 2, 2009 at 11:49 AM, Bnet  wrote:
>
> Thanks for your time Marco, added the following to the manifest. There
> is an error in MyPhoneStateListener as shown below:
>
>         
>                
>                 android:name="android.intent.action.SoundNotification" />

You should use the same string here that you use for the intent
action, i.e. "com.bnet.detectmissedcall.SoundNotification"

>                
>         
>
>
> Error: The method startActivity(Intent) is undefined for the type
> MyPhoneStateListener
>
> Intent i = new Intent("com.bnet.detectmissedcall.SoundNotification");
> startActivity(i);

You will need to have a Context to call startActivity() on. It's not
clear to me how you create your PhoneStateListener, but the Activity
or Service that you create it in should have a Context for you to use.

--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-02 Thread Bnet

Thanks for your time Marco, added the following to the manifest. There
is an error in MyPhoneStateListener as shown below:

 



 


Error: The method startActivity(Intent) is undefined for the type
MyPhoneStateListener

Intent i = new Intent("com.bnet.detectmissedcall.SoundNotification");
startActivity(i);


On Mar 2, 1:33 pm, Marco Nelissen  wrote:
> The problem is that in your manifest you do not specify an intent
> filter for your activity, so the system doesn't know what to launch.
> You either have to specify an intent filter for your activity in the
> manifest, or you need to create the intent such that it explicitly
> specifies the activity you want to start.
>
>
>
> On Mon, Mar 2, 2009 at 11:25 AM, Bnet  wrote:
>
> > Thanks. Sorry, thought it was in the first messge.
>
> > The problem is being new to Android and not being able successfully
> > create an intent to call another class.
>
> > Intent i = new Intent
> > ("com.bnet.detectmissedcall.SoundNotification");
> > startActivity(i);
>
> > On Mar 2, 1:05 pm, Marco Nelissen  wrote:
> >> It might help if you told us what exactly the problem is.
>
> >> On Mon, Mar 2, 2009 at 8:04 AM, Bnet  wrote:
>
> >> > Problem starting a new activity, please see below...
>
> >> > public class MyPhoneStateListener extends PhoneStateListener {
>
> >> >         final static String TAGTEXT = "DEBUG LISTENER!!!";
> >> >     boolean ringing = false;
> >> >     boolean offhook = false;
>
> >> >   �...@override
> >> >        public void onCallStateChanged(int state,String incomingNumber){
> >> >                switch(state)
> >> >        {
> >> >     case TelephonyManager.CALL_STATE_IDLE:
> >> >          Log.d(TAGTEXT,"IDLE");
> >> >          Log.d(TAGTEXT,"ringing "+ringing+" offhook "+offhook);
> >> >          if(ringing&&(!offhook))
> >> >          {
> >> >               Log.d(TAGTEXT, "You have missed a call");
> >> >                ringing = false;
> >> >                offhook = false;
>
> >> >              //problem//
> >> >                Intent i = new Intent
> >> > ("com.bnet.detectmissedcall.SoundNotification");
> >> >                startActivity(i);
>
> >> >          break; }
>
> >> >     case TelephonyManager.CALL_STATE_RINGING:
> >> >          Log.d(TAGTEXT, "RINGING");
> >> >          ringing = true;
> >> >          offhook = false;
>
> >> >          break;
> >> >     case TelephonyManager.CALL_STATE_OFFHOOK:
> >> >          Log.d(TAGTEXT, "OFFHOOK");
> >> >          offhook = true;
> >> >          ringing = false;
> >> >          break;
>
> >> >     default:
>
> >> >          break;
> >> >     }
>
> >> >    }
>
> >> > }- Hide quoted text -
>
> >> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-02 Thread Marco Nelissen

The problem is that in your manifest you do not specify an intent
filter for your activity, so the system doesn't know what to launch.
You either have to specify an intent filter for your activity in the
manifest, or you need to create the intent such that it explicitly
specifies the activity you want to start.


On Mon, Mar 2, 2009 at 11:25 AM, Bnet  wrote:
>
> Thanks. Sorry, thought it was in the first messge.
>
> The problem is being new to Android and not being able successfully
> create an intent to call another class.
>
> Intent i = new Intent
> ("com.bnet.detectmissedcall.SoundNotification");
> startActivity(i);
>
>
> On Mar 2, 1:05 pm, Marco Nelissen  wrote:
>> It might help if you told us what exactly the problem is.
>>
>>
>>
>> On Mon, Mar 2, 2009 at 8:04 AM, Bnet  wrote:
>>
>> > Problem starting a new activity, please see below...
>>
>> > public class MyPhoneStateListener extends PhoneStateListener {
>>
>> >         final static String TAGTEXT = "DEBUG LISTENER!!!";
>> >     boolean ringing = false;
>> >     boolean offhook = false;
>>
>> >   �...@override
>> >        public void onCallStateChanged(int state,String incomingNumber){
>> >                switch(state)
>> >        {
>> >     case TelephonyManager.CALL_STATE_IDLE:
>> >          Log.d(TAGTEXT,"IDLE");
>> >          Log.d(TAGTEXT,"ringing "+ringing+" offhook "+offhook);
>> >          if(ringing&&(!offhook))
>> >          {
>> >               Log.d(TAGTEXT, "You have missed a call");
>> >                ringing = false;
>> >                offhook = false;
>>
>> >              //problem//
>> >                Intent i = new Intent
>> > ("com.bnet.detectmissedcall.SoundNotification");
>> >                startActivity(i);
>>
>> >          break; }
>>
>> >     case TelephonyManager.CALL_STATE_RINGING:
>> >          Log.d(TAGTEXT, "RINGING");
>> >          ringing = true;
>> >          offhook = false;
>>
>> >          break;
>> >     case TelephonyManager.CALL_STATE_OFFHOOK:
>> >          Log.d(TAGTEXT, "OFFHOOK");
>> >          offhook = true;
>> >          ringing = false;
>> >          break;
>>
>> >     default:
>>
>> >          break;
>> >     }
>>
>> >    }
>>
>> > }- Hide quoted text -
>>
>> - Show quoted text -
> >
>

--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-02 Thread Bnet

Manifest...

Following is the manifest...



http://schemas.android.com/apk/res/android";
  package="com.bnet.detectmissedcall"
  android:versionCode="1"
  android:versionName="1.0.0">







 
 















On Mar 2, 1:25 pm, Bnet  wrote:
> Thanks. Sorry, thought it was in the first messge.
>
> The problem is being new to Android and not being able successfully
> create an intent to call another class.
>
> Intent i = new Intent
> ("com.bnet.detectmissedcall.SoundNotification");
> startActivity(i);
>
> On Mar 2, 1:05 pm, Marco Nelissen  wrote:
>
>
>
> > It might help if you told us what exactly the problem is.
>
> > On Mon, Mar 2, 2009 at 8:04 AM, Bnet  wrote:
>
> > > Problem starting a new activity, please see below...
>
> > > public class MyPhoneStateListener extends PhoneStateListener {
>
> > >         final static String TAGTEXT = "DEBUG LISTENER!!!";
> > >     boolean ringing = false;
> > >     boolean offhook = false;
>
> > >   �...@override
> > >        public void onCallStateChanged(int state,String incomingNumber){
> > >                switch(state)
> > >        {
> > >     case TelephonyManager.CALL_STATE_IDLE:
> > >          Log.d(TAGTEXT,"IDLE");
> > >          Log.d(TAGTEXT,"ringing "+ringing+" offhook "+offhook);
> > >          if(ringing&&(!offhook))
> > >          {
> > >               Log.d(TAGTEXT, "You have missed a call");
> > >                ringing = false;
> > >                offhook = false;
>
> > >              //problem//
> > >                Intent i = new Intent
> > > ("com.bnet.detectmissedcall.SoundNotification");
> > >                startActivity(i);
>
> > >          break; }
>
> > >     case TelephonyManager.CALL_STATE_RINGING:
> > >          Log.d(TAGTEXT, "RINGING");
> > >          ringing = true;
> > >          offhook = false;
>
> > >          break;
> > >     case TelephonyManager.CALL_STATE_OFFHOOK:
> > >          Log.d(TAGTEXT, "OFFHOOK");
> > >          offhook = true;
> > >          ringing = false;
> > >          break;
>
> > >     default:
>
> > >          break;
> > >     }
>
> > >    }
>
> > > }- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-02 Thread Bnet

Thanks. Sorry, thought it was in the first messge.

The problem is being new to Android and not being able successfully
create an intent to call another class.

Intent i = new Intent
("com.bnet.detectmissedcall.SoundNotification");
startActivity(i);


On Mar 2, 1:05 pm, Marco Nelissen  wrote:
> It might help if you told us what exactly the problem is.
>
>
>
> On Mon, Mar 2, 2009 at 8:04 AM, Bnet  wrote:
>
> > Problem starting a new activity, please see below...
>
> > public class MyPhoneStateListener extends PhoneStateListener {
>
> >         final static String TAGTEXT = "DEBUG LISTENER!!!";
> >     boolean ringing = false;
> >     boolean offhook = false;
>
> >   �...@override
> >        public void onCallStateChanged(int state,String incomingNumber){
> >                switch(state)
> >        {
> >     case TelephonyManager.CALL_STATE_IDLE:
> >          Log.d(TAGTEXT,"IDLE");
> >          Log.d(TAGTEXT,"ringing "+ringing+" offhook "+offhook);
> >          if(ringing&&(!offhook))
> >          {
> >               Log.d(TAGTEXT, "You have missed a call");
> >                ringing = false;
> >                offhook = false;
>
> >              //problem//
> >                Intent i = new Intent
> > ("com.bnet.detectmissedcall.SoundNotification");
> >                startActivity(i);
>
> >          break; }
>
> >     case TelephonyManager.CALL_STATE_RINGING:
> >          Log.d(TAGTEXT, "RINGING");
> >          ringing = true;
> >          offhook = false;
>
> >          break;
> >     case TelephonyManager.CALL_STATE_OFFHOOK:
> >          Log.d(TAGTEXT, "OFFHOOK");
> >          offhook = true;
> >          ringing = false;
> >          break;
>
> >     default:
>
> >          break;
> >     }
>
> >    }
>
> > }- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-02 Thread Marco Nelissen

It might help if you told us what exactly the problem is.


On Mon, Mar 2, 2009 at 8:04 AM, Bnet  wrote:
>
> Problem starting a new activity, please see below...
>
>
> public class MyPhoneStateListener extends PhoneStateListener {
>
>         final static String TAGTEXT = "DEBUG LISTENER!!!";
>     boolean ringing = false;
>     boolean offhook = false;
>
>
>
>   �...@override
>        public void onCallStateChanged(int state,String incomingNumber){
>                switch(state)
>        {
>     case TelephonyManager.CALL_STATE_IDLE:
>          Log.d(TAGTEXT,"IDLE");
>          Log.d(TAGTEXT,"ringing "+ringing+" offhook "+offhook);
>          if(ringing&&(!offhook))
>          {
>               Log.d(TAGTEXT, "You have missed a call");
>                ringing = false;
>                offhook = false;
>
>              //problem//
>                Intent i = new Intent
> ("com.bnet.detectmissedcall.SoundNotification");
>                startActivity(i);
>
>
>
>
>          break; }
>
>     case TelephonyManager.CALL_STATE_RINGING:
>          Log.d(TAGTEXT, "RINGING");
>          ringing = true;
>          offhook = false;
>
>          break;
>     case TelephonyManager.CALL_STATE_OFFHOOK:
>          Log.d(TAGTEXT, "OFFHOOK");
>          offhook = true;
>          ringing = false;
>          break;
>
>     default:
>
>          break;
>     }
>
>
>
>    }
>
>
> }
>
> >
>

--~--~-~--~~~---~--~~
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: Problem Starting New Activity

2009-03-02 Thread Bnet


Please see //Problem where the new intent is created...



On Mar 2, 10:09 am, Bnet  wrote:
> public class MyPhoneStateListener extends PhoneStateListener {
>
>          final static String TAGTEXT = "DEBUG LISTENER!!!";
>      boolean ringing = false;
>      boolean offhook = false;
>
>     @Override
>         public void onCallStateChanged(int state,String incomingNumber){
>                 switch(state)
>         {
>      case TelephonyManager.CALL_STATE_IDLE:
>           Log.d(TAGTEXT,"IDLE");
>           Log.d(TAGTEXT,"ringing "+ringing+" offhook "+offhook);
>           if(ringing&&(!offhook))
>           {
>                Log.d(TAGTEXT, "You have missed a call");
>                 ringing = false;
>                 offhook = false;
>
>                 Intent i = new Intent
> ("com.bnet.detectmissedcall.SoundNotification");
>                 startActivity(i);
>
>           break; }
>
>      case TelephonyManager.CALL_STATE_RINGING:
>           Log.d(TAGTEXT, "RINGING");
>           ringing = true;
>           offhook = false;
>
>           break;
>      case TelephonyManager.CALL_STATE_OFFHOOK:
>           Log.d(TAGTEXT, "OFFHOOK");
>           offhook = true;
>           ringing = false;
>           break;
>
>      default:
>
>           break;
>      }
>
>     }
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---