android用户界面设计

1.android.provider包下的常用类

  该包下提供了访问联系人信息,日历信息,多媒体文件的类。

   常用的类。

   MediaStore.Audio.Media类

   public static final Uri EXTERNAL_CONTENT_URI;

   The content:// style URI for the "primary" external storage volume.

   String DEFAULT_SORT_ORDER ;//The default sort order for this table

2.创建菜单

  OptionMenu:用户点击“Menu”键后,显示在界面的底部的菜单

  ContextMenu:用户长按列表上的item时,会显示出来一个菜单

  在Activity里覆盖这两个方法

@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        //调用add方法添加菜单选项
//        menu.add(0,OPTON_ITEM_EXIT, 0, R.string.option_exit);
//        menu.add(0,OPTON_ITEM_SCAN, 1, R.string.option_scan);
        //第二种方法使用Menuinflater方法布局选项
        MenuInflater menuinflater=getMenuInflater();
        menuinflater.inflate(R.menu.option_menu, menu);
        return true;
    }
    @Override
    public void onCreateContextMenu(ContextMenu menu, View v,
            ContextMenuInfo menuInfo) {
        //为该listview注册contextmenu
            
        //布局contextmenu,也可以使用menuinflater来指定xml布局
           menu.add(0, CONTEXT_OPTION_DELETE, 0,R.string.context_option_delete);
           menu.add(1,CONTEXT_OPTION_PROPERTY,0,R.string.context_option_property);
           registerForContextMenu(getListView()); 
    }

3.Dialog

   android提供了4种类型的dialog:AlertDialog,ProgressDialog,DatePickerDialog,TimePickerDialog

转载于:https://www.cnblogs.com/beyondbycyx/p/4333997.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值