• 大小: 296KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-29
  • 语言: Java
  • 标签:

资源简介

ca.jkiv.RingLoudContacts Note: this app may require caller-ID. This is an Android app that maximizes the phone's volume when certain numbers are calling. These numbers are specified by the user. The user can add one of his/her contacts or specify a number manually. Author: Jon Kivinen License: BSD

资源截图

代码片段和文件信息

package ca.jkiv.RingLoudContacts;

import java.io.InputStream;
import java.util.linkedList;
import java.util.List;

import android.app.AlertDialog;
import android.app.ListActivity;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.onclickListener;
import android.content.Intent;
import android.database.Cursor;
import android.database.DataSetObserver;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.PhoneLookup;
import android.text.InputType;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

/**
 * The activity for editing the contacts list.
 * 
 * @author Jon Kivinen 
 */
public class ContactsListActivity extends ListActivity
{
    private static final String LOG_TAG = “ContactsListActivity“;
    private static final int CHOOSE_CONTACT_RESULT = 1001;
    private List listData;
    
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        // Set empty contact list layout
        setContentView(R.layout.contacts_list_empty);
        
        // Register context menu
        registerForContextMenu(getListView());

        // Populate list
        listData = ContactsListPersistence.getContactList(this);

        // Create an array adapter for listData
        ContactsListAdapter adapter = new ContactsListAdapter(this listData);

        // Create observer to update SharedPreferences when the list changes
        adapter.registerDataSetObserver(new DataSetObserver()
        {
            @Override
            public void onchanged()
            {
                // Update shared preferences
                ContactsListPersistence.setContactList(ContactsListActivity.this listData);
            }
        });
        
        // Set list adapter
        setListAdapter(adapter);
    }
    
    @Override
    /**
     * Edit a list item when it is clicked.
     */
    protected void onListItemClick (ListView l View v int position long id)
    {
        editNumberByDialog(id);
    }
    
    @Override
    /**
     * Called when context menu is created.
     */
    public void onCreateContextMenu(ContextMenu menu View view ContextMenuInfo menuInfo)  
    {
     

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-04 19:17  RingLoudContacts-master\
     文件          59  2018-04-04 19:17  RingLoudContacts-master\.gitignore
     文件        1364  2018-04-04 19:17  RingLoudContacts-master\AndroidManifest.xml
     文件         617  2018-04-04 19:17  RingLoudContacts-master\README.md
     文件         364  2018-04-04 19:17  RingLoudContacts-master\default.properties
     文件      115133  2018-04-04 19:17  RingLoudContacts-master\hi-res.png
     文件       28696  2018-04-04 19:17  RingLoudContacts-master\ic_launcher_ringloudcontacts.svg
     目录           0  2018-04-04 19:17  RingLoudContacts-master\res\
     目录           0  2018-04-04 19:17  RingLoudContacts-master\res\drawable-hdpi\
     文件        8305  2018-04-04 19:17  RingLoudContacts-master\res\drawable-hdpi\ic_contact_unknown.png
     文件        6610  2018-04-04 19:17  RingLoudContacts-master\res\drawable-hdpi\ic_launcher_ring_loud_contacts.png
     目录           0  2018-04-04 19:17  RingLoudContacts-master\res\drawable-ldpi\
     文件        4477  2018-04-04 19:17  RingLoudContacts-master\res\drawable-ldpi\ic_contact_unknown.png
     文件        2276  2018-04-04 19:17  RingLoudContacts-master\res\drawable-ldpi\ic_launcher_ring_loud_contacts.png
     目录           0  2018-04-04 19:17  RingLoudContacts-master\res\drawable-mdpi\
     文件        5260  2018-04-04 19:17  RingLoudContacts-master\res\drawable-mdpi\ic_contact_unknown.png
     文件        3585  2018-04-04 19:17  RingLoudContacts-master\res\drawable-mdpi\ic_launcher_ring_loud_contacts.png
     目录           0  2018-04-04 19:17  RingLoudContacts-master\res\layout\
     文件         928  2018-04-04 19:17  RingLoudContacts-master\res\layout\about_dialog.xml
     文件        1549  2018-04-04 19:17  RingLoudContacts-master\res\layout\contacts_list.xml
     文件         790  2018-04-04 19:17  RingLoudContacts-master\res\layout\contacts_list_empty.xml
     文件         735  2018-04-04 19:17  RingLoudContacts-master\res\layout\edittext_dialog.xml
     目录           0  2018-04-04 19:17  RingLoudContacts-master\res\menu\
     文件         838  2018-04-04 19:17  RingLoudContacts-master\res\menu\contacts_list_context_menu.xml
     文件        1664  2018-04-04 19:17  RingLoudContacts-master\res\menu\contacts_list_menu.xml
     目录           0  2018-04-04 19:17  RingLoudContacts-master\res\values\
     文件        3550  2018-04-04 19:17  RingLoudContacts-master\res\values\strings.xml
     目录           0  2018-04-04 19:17  RingLoudContacts-master\res\xml\
     文件         963  2018-04-04 19:17  RingLoudContacts-master\res\xml\preferences.xml
     目录           0  2018-04-04 19:17  RingLoudContacts-master\screenshots\
     文件       46250  2018-04-04 19:17  RingLoudContacts-master\screenshots\contacts.png
............此处省略14个文件信息

评论

共有 条评论