android使用者介面設計

來源:互聯網
上載者:User

標籤:

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

android使用者介面設計

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.