The code is below for the main activity and the Manifest.
THe Menu Activity (started from this) works fine independent of this.
==========
public class InCall extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
myListener test = new myListener();
TelephonyManager myManager = (TelephonyManager)getSystemService
(TELEPHONY_SERVICE);
myManager.listen(test, test.LISTEN_CALL_STATE);
}
public class myListener extends PhoneStateListener {
/** Called when the activity is first created. */
@Override
public void onCallStateChanged (int state, String number) {
if ((prevState == CALL_RING) && (state ==
CALL_IDLE)){
Intent i = new Intent();
i.setClassName("com.agnity.android.incall",
"com.agnity.android.incall.Menu");
i.setFlags(i.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
}
prevState = state;
}
}
}
=====================Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.agnity.android.incall">
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name=".InCall" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
</activity>
<activity android:name="Menu">
</activity>
</application>
</manifest>
On Thu, Sep 11, 2008 at 2:36 PM, EMA <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've an application whose flow should be like this:
>
> 1) Start Activity to listen to some telephony events
> 2) On receive of these events, display a menu to
> 3) get user input on the menu
> 4) perform some action
> 5) done go back to 1
>
> I do this by creating a listener of events in Activity A. On receipt
> of Events I start a new activity for
> showing Menu. But I find that menu doesn't wait for user inputs and
> goes off immediately.
>
> I've not implemented any onPause() or onResume().
>
> May I know what should be done?
>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---