0
点赞
收藏
分享

微信扫一扫

android 用action拦截打电话界面


一、打电话

Intent intent = new Intent(Intent.ACTION_CALL,Uri.parse("tel:123123"));

 

  

二、写一个activity

public class CallView extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
   // TODO Auto-generated method stub
   super.onCreate(savedInstanceState);
   TextView textView = new TextView(this);
   textView.setTextColor(Color.WHITE);
   textView.setTextSize(200);
   textView.setText("打电话");
   setContentView(textView);
  }
 }

重要的地方的是在AndroidManifest.xml 里面

<activity android:name=".CallView">
             <intent-filter>
                 <action android:name="android.intent.action.CALL"/>
                <data android:scheme="tel"/>
             </intent-filter>

红色的字体的文本其实是相对应的,一个发送动作,一个接受动作;

蓝色字体的文本其实也是相对应的,我理解为一种“标志”那么红色和蓝色相结合就是电话页面弹出的信号了

可以去网上搜集一下资料;

举报

相关推荐

0 条评论