direktori cari
android Manifest Manifest.permission Manifest.permission_group android.accessibilityservice AccessibilityService android.accounts Account android.app NotificationManager android.bluetooth BluetoothAdapter BluetoothClass BluetoothClass.Device BluetoothClass.Device.Major BluetoothClass.Service BluetoothDevice BluetoothServerSocket BluetoothSocket android.content SharedPreferences android.database.sqlite SQLiteCursorDriver SQLiteOpenHelper android.graphics Bitmap android.location LocationListener Geocoder GpsStatus GpsStatus.Listener GpsStatus.NmeaListener GpsSatellite android.media AudioFormat AsyncPlayer AudioRecord AudioRecord.OnRecordPositionUpdateListener ThumbnailUtils AudioManager android.net TrafficStats MailTo LocalSocket android.os AsyncTask AsyncTask.Status CountDownTimer Message MessageQueue HandlerThread android.text Html android.util JsonWriter android.view ContextMenu ContextMenu.ContextMenuInfo Display ViewManager View ViewStub ViewTreeObserver ViewParent WindowManager GestureDetector Gravity MenuInflater ScaleGestureDetector SoundEffectConstants android.view.inputmethod InputConnection InputMethod InputMethodSession BaseInputConnection InputMethodManager android.widget AbsListView AbsListView.LayoutParams AbsListView.OnScrollListener AbsListView.RecyclerListener AbsoluteLayout AbsoluteLayout.LayoutParams AbsSeekBar AbsSpinner AdapterView AdapterView.AdapterContextMenuInfo AdapterView.OnItemLongClickListener AdapterView.OnItemSelectedListener AdapterView.OnItemClickListener AnalogClock BaseAdapter BaseExpandableListAdapter Button CheckBox CheckedTextView Checkable Chronometer Chronometer.OnChronometerTickListener CompoundButton CompoundButton.OnCheckedChangeListener CursorAdapter CursorTreeAdapter DatePicker DatePicker.OnDateChangedListener DialerFilter DigitalClock EditText Filter Filter.FilterListener Filter.FilterResults ExpandableListAdapter ExpandableListView.OnChildClickListener ExpandableListView.OnGroupClickListener ExpandableListView.OnGroupCollapseListener ExpandableListView.OnGroupExpandListener Filterable Gallery Gallery.LayoutParams GridView GridLayout GridLayout.Alignment RadioGroup ImageView ImageView.ScaleType HorizontalScrollView ImageButton ImageSwitcher FilterQueryProvider ListAdapter ListView MediaController MultiAutoCompleteTextView MultiAutoCompleteTextView.CommaTokenizer MultiAutoCompleteTextView.Tokenizer QuickContactBadge RadioButton RatingBar RatingBar.OnRatingBarChangeListener RelativeLayout RemoteViews ResourceCursorAdapter ResourceCursorTreeAdapter Scroller ScrollView SearchView SearchView.OnCloseListener SearchView.OnQueryTextListener SearchView.OnSuggestionListener SeekBar SeekBar.OnSeekBarChangeListener SimpleAdapter SimpleAdapter.ViewBinder SimpleCursorAdapter SimpleCursorAdapter.CursorToStringConverter SimpleCursorAdapter.ViewBinder SimpleCursorTreeAdapter SimpleCursorTreeAdapter.ViewBinder SimpleExpandableListAdapter SlidingDrawer SlidingDrawer.OnDrawerCloseListener SlidingDrawer.OnDrawerOpenListener SlidingDrawer.OnDrawerScrollListener Spinner SpinnerAdapter WrapperListAdapter TabHost TabHost.TabSpec TextView TimePicker TimePicker.OnTimeChangedListener Toast TableLayout TableLayout.LayoutParams TableRow TableRow.LayoutParams TabWidget TextSwitcher ToggleButton TwoLineListItem VideoView ViewAnimator ViewFlipper ViewSwitcher ViewSwitcher.ViewFactory ZoomButtonsController ZoomButtonsController.OnZoomListener ZoomButton ZoomControls dalvik.system DexFile
watak


WindowManager

版本:Android 2.3 r1

 

结构

继承关系

public interface WindowManager extends android.view.ViewManager

        

android.view.WindowManager

 

类概述

该接口用于与窗口管理器交互。通过 Context.getSystemService(Context.WINDOW_SERVICE)可以获取到WindowManager的实例。(译者注:如:WindowManager wm = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);

  参见

            getSystemService(String)

    WINDOW_SERVICE

 

内部类

public static class  WindowManager.LayoutParams

(译者注:继承自android.view.ViewGroup.LayoutParams

 

public static class   WindowManager.BadTokenException       

添加view时,如果该viewWindowManager.LayoutParams的令牌(token)无效,则会抛出该异常

 

公共方法

public abstract Display  getDefaultDisplay()

         获取默认的显示对象

                   返回值

                            默认的Display对象

                  

public abstract void removeViewImmediate (View view)

removeView(View) 的一个特殊扩展,在方法返回前能够立即调用该视图层次的View.onDetachedFromWindow() 方法。 不适用于一般的程序;如果您要正确无误的使用它,那您就需要格外小心了。

参数

                            view 需要移除的视图

 

补充

文章链接

WindowManagerDemo

         示例代码(来自文章链接的代码)

        public class WindowManagerDemo extends Activity {

       

        @Override

        public void onCreate(Bundle savedInstanceState) {

               super.onCreate(savedInstanceState);

               setContentView(R.layout.main);

               TextView textView = (TextView) findViewById(R.id.label);

               WindowManager windowManager = (WindowManager)

               getSystemService(Context.WINDOW_SERVICE);

 

               // print the current window's width and height on the title, eg: 320*480

        setTitle(windowManager.getDefaultDisplay().getWidth() + "*"

                               + windowManager.getDefaultDisplay().getHeight());

               textView.setText("See the Title");

        }

}

 

 


Artikel sebelumnya: Artikel seterusnya: