ITeye博客

流沙-只如初见的博客

流沙-只如初见 · 共 2 篇文章

UI布局设计之加载xml

一般在activity中通过setContentView()将界面显示出来,但是如果在非activity中如何对控件布局设置操作,这需LayoutInflater动态加载 Activity中调用layout 1.setContentView(R.layout.main) 一旦调用, layout就会立刻显示UI 2.调用xml mWidgetCanvas = (WidgetCellLayout) getFragmentManager().findFragmentById( R.id.canvas_content); 其中public final class WidgetCellLayout …

2012-09-19 10:47 · 评论(0)

androidU盘检测

在网上查了一些资料。U盘检测的方法一般有两种方式,检测电池或者查看配置信息。 1.Batterymanager检测方法如下: IntentFilter mIntentFilter = new IntentFilter(); mIntentFilter.addAction(Intent.ACTION_BATTERY_CHANGED); registerReceiver(BtStatusReceiver, mIntentFilter); public BroadcastReceiver BtStatusReceiver = new BroadcastReceiver() // receive b…

2012-08-18 09:19 · 评论(1)