Hi,
I need to take off the "missed calls" notification issued by the built-
in PHONE application. Since there is no setting in it to NOT display
the notification, I have to do it in my code (unless I missed
somthing... ?)
I thought about launching the built-in call log (thus it will remove
the notification), set a timer (using 'postDelayed' with a
'runnable'), and in the delayed callback launch my own app.
For some reason my own app wont launch from the callback.
This is how I launch the internal call log:
[syntax="java"] public void StartInternalAfterCallHandler()
{
Intent startActivity = new Intent();
startActivity.setAction
("android.intent.action.VIEW");
startActivity.addCategory("android.intent.category.DEFAULT");
startActivity.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED |
//Intent.FLAG_ACTIVITY_CLEAR_TOP |
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);// |
//Intent.FLAG_ACTIVITY_SINGLE_TOP |
//Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity.setType("vnd.android.cursor.dir/calls");
startActivity.setComponent(new ComponentName
("com.android.contacts","com.android.contacts.DialtactsActivity"));
startActivity(startActivity);
}
[/syntax]
Then I call:
[syntax="java"]
mAsyncAfterCallHandler.postDelayed(mAsyncAfterCallTask,
10000);
[/syntax]
and in the callback:
[syntax="java"]
SharedPreferences settings = getSharedPreferences(Preferences.NAME,
0);
SharedPreferences.Editor editor = settings.edit();
editor.putInt(Preferences.KEY_OPEN_IN_TAB, 0);
editor.commit();
Intent startActivity = new Intent();
startActivity.setAction
("android.intent.action.MAIN");
startActivity.addCategory("android.intent.category.LAUNCHER");
startActivity.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED |
//Intent.FLAG_ACTIVITY_CLEAR_TOP |
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS |
Intent.FLAG_ACTIVITY_SINGLE_TOP |
Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity.setComponent(new ComponentName
("com.shsh.android.takephone","com.shsh.android.takephone.TAKEphONE"));
startActivity(startActivity);
[/syntax]
In DDMS I see the 'startActivity' fired, but my app wont launch.
Any help ?
TIA
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---