Thanks for your time Marco, added the following to the manifest. There
is an error in MyPhoneStateListener as shown below:
<activity android:name=".SoundNotification">
<intent-filter>
<action
android:name="android.intent.action.SoundNotification" />
</intent-filter>
</activity>
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 <[email protected]> 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 <[email protected]> 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 <[email protected]> wrote:
> >> It might help if you told us what exactly the problem is.
>
> >> On Mon, Mar 2, 2009 at 8:04 AM, Bnet <[email protected]> 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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---