• 大小: 0.04M
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-01-25
  • 语言: Java
  • 标签: Android  监听  手机  d  来电  

资源简介

android 监听手机状态变化(来电、挂断)

资源截图

代码片段和文件信息

package com.easymorse.phonestate;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity {

TelephonyManager manager;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

manager = (TelephonyManager) this.getSystemService(TELEPHONY_SERVICE);

manager.listen(new MyPhoneStateListener()
PhoneStateListener.LISTEN_CALL_STATE);
}

class MyPhoneStateListener extends PhoneStateListener {

@Override
public void onCallStateChanged(in

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        440  2011-12-12 11:04  android_phone_state\.svn\all-wcprops

     文件        767  2011-12-12 11:04  android_phone_state\.svn\entries

     文件        866  2011-12-12 11:04  android_phone_state\.svn\text-base\AndroidManifest.xml.svn-base

     文件        362  2011-12-12 11:04  android_phone_state\.svn\text-base\default.properties.svn-base

     文件       1159  2011-12-12 11:04  android_phone_state\.svn\text-base\proguard.cfg.svn-base

     文件        866  2011-12-12 11:04  android_phone_state\AndroidManifest.xml

     文件         91  2011-12-12 11:04  android_phone_state\assets\.svn\all-wcprops

     文件        238  2011-12-12 11:04  android_phone_state\assets\.svn\entries

     文件        362  2011-12-12 11:04  android_phone_state\default.properties

     文件       1159  2011-12-12 11:04  android_phone_state\proguard.cfg

     文件         88  2011-12-12 11:04  android_phone_state\res\.svn\all-wcprops

     文件        321  2011-12-12 11:04  android_phone_state\res\.svn\entries

     文件        222  2011-12-12 11:04  android_phone_state\res\drawable-hdpi\.svn\all-wcprops

     文件        418  2011-12-12 11:04  android_phone_state\res\drawable-hdpi\.svn\entries

     文件         53  2011-12-12 11:04  android_phone_state\res\drawable-hdpi\.svn\prop-base\icon.png.svn-base

     文件       4147  2011-12-12 11:04  android_phone_state\res\drawable-hdpi\.svn\text-base\icon.png.svn-base

     文件       4147  2011-12-12 11:04  android_phone_state\res\drawable-hdpi\icon.png

     文件        222  2011-12-12 11:04  android_phone_state\res\drawable-ldpi\.svn\all-wcprops

     文件        418  2011-12-12 11:04  android_phone_state\res\drawable-ldpi\.svn\entries

     文件         53  2011-12-12 11:04  android_phone_state\res\drawable-ldpi\.svn\prop-base\icon.png.svn-base

     文件       1723  2011-12-12 11:04  android_phone_state\res\drawable-ldpi\.svn\text-base\icon.png.svn-base

     文件       1723  2011-12-12 11:04  android_phone_state\res\drawable-ldpi\icon.png

     文件        222  2011-12-12 11:04  android_phone_state\res\drawable-mdpi\.svn\all-wcprops

     文件        418  2011-12-12 11:04  android_phone_state\res\drawable-mdpi\.svn\entries

     文件         53  2011-12-12 11:04  android_phone_state\res\drawable-mdpi\.svn\prop-base\icon.png.svn-base

     文件       2574  2011-12-12 11:04  android_phone_state\res\drawable-mdpi\.svn\text-base\icon.png.svn-base

     文件       2574  2011-12-12 11:04  android_phone_state\res\drawable-mdpi\icon.png

     文件        208  2011-12-12 11:04  android_phone_state\res\layout\.svn\all-wcprops

     文件        401  2011-12-12 11:04  android_phone_state\res\layout\.svn\entries

     文件        556  2011-12-12 11:04  android_phone_state\res\layout\.svn\text-base\main.xml.svn-base

............此处省略126个文件信息

评论

共有 条评论