Monday, June 21, 2010

[android-developers] Intercepting an outgoing call

hi guys,

i saw many people have raise the same question but could not find the
solution and mine is little bit different.

this application is working properly in HTC TATTOO but in Motorola
Milestone i'm getting this issue.

in milestone outgoing call is detecting and even it's been pass to
relevant class. but suddenly focus is getting lost and the default
call application is displayed. don't have any idea how this works
properly in HTC and not in Milestone.

please share your ideas here

i have a receiver which will listen for out going calls

public class CallListener extends BroadcastReceiver {
private Context context;
String phonenbr;
TelephonyManager telManager;
Handler handler = new Handler();

@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
this.context = context;
// this.intentttt = intent;
// String s = intent.getAction();

if (intent.getAction()
.equalsIgnoreCase(Intent.ACTION_NEW_OUTGOING_CALL)) {
phonenbr = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
intent = new Intent(context, OutGoing.class);
Log.d("GDHGDHGHDGDHGDHGHDGHDGH", phonenbr);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("Number", phonenbr);
context.startActivity(intent);
return;
}
}
}

in the manifest

<receiver android:name=".listener.CallListener" >
<intent-filter android:priority="2147483647">
<action
android:name="android.intent.action.PHONE_STATE"/>
<action
android:name="android.intent.action.NEW_OUTGOING_CALL"/
>
</intent-filter>
</receiver>

this is my outGoing.java class

public class OutGoing extends Activity {
Map<String, String> map;
String mobileNumber;
Handler handler = new Handler();

@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
colorMap();
Bundle bundle = getIntent().getExtras();
String number = bundle.getString("Number");
// alert("Number", number);
details(number);
TextView t = new TextView(this);
t.setText("TEst");

}
}

regards,
Mike

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate