WindowManagerDemo

WindowManager

译者署名:逝憶流緣

译者链接:http://t.qq.com/pansonphy

版本: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时,如果该view的WindowManager.LayoutParams的令牌(token)无效,则会抛出该异常

公共方法

public abstract Display  getDefaultDisplay()

获取默认的显示对象

返回值

默认的Display对象

public abstract void removeViewImmediate (View view)

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

参数

view 需要移除的视图

示例代码:

package com.cnAndroid.apidemo;
 
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.TextView;
 
public class WindowManagerDemo extends Activity {
	/** Called when the activity is first created. */
	@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");
	}
}

Source:WindowManagerDemo

Flex and BlazeDS with RemoteObject example

These days, I studied the Flex and BlazeDS. Installed the Flex Builder 3.0, and the Flex Builder 3 Plug-in for Eclipse, studied the Action Script, and Flex Integration with J2EE. BlazeDS is a series of data services that provide your Flex applications with additional data connectivity options: Remoting Service, Message Service, Proxy Service.

  Remoting Service allows your Flex application to directly invoke methods of Java objects deployed in your application server.

  Message Service provides a publish/subscribe infrastructure that allows your Flex application to publish messages and subscribe to a messaging destination, enabling the development of real-time data push and collaborative applications. For example, JMS.

  Proxy Service allows your Flex application to make cross-domain service requests in a secure and controlled manner. In other words, it allows your Flex application to access a service available on a domain other than the domain from which the application was downloaded (without having to deploy a crossdomain.xml policy file on the target domain).

There are many instances on the net, where someone justonly received data from data set. The following example application shows the way to get data push with the Remote Service way. And also save, update, and delete.

Get the source here:FlexMessages.

Name.com Promo Code January 2010

Promo Code | January
PROMO19735 | $8.25 COM Registration
PROMO71403 | $8.20 COM/NET Renewal
PROMO04582 | $8.15 INFO/ORG Renewal

Promo Code | December 2009
KILLIGREW | $14.99 Domain Nabber
CRICKETT | $8.25 COM/NET Renewal
OMALLEY | $8.20 COM Registration

The Saltwater Room

Download The Saltwater Room.mp3

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

I opened my eyes last night and saw you in the low light
Walking down by the bay, on the shore,
Staring up at the planes that aren’t there anymore
I was feeling the night grow old and you were looking so cold
Like an introvert, I drew my over shirt
Around my arms and began to shiver violently before
You happened to look and see the tunnels all around me
Running into the dark underground
All the subways around create a great sound
To my motion fatigue: farewell
With your ear to a seashell
You can hear the waves in underwater caves
As if you actually were inside a saltwater room
Time together is just never quite enough
When you and I are alone, I’ve never felt so at home
What will it take to make or break this hint of love?
We need time, only time
When we’re apart whatever are you thinking of?
If this is what I call home, why does it feel so alone?
So tell me darling, do you wish we’d fall in love?
All the time, all the time
Can you believe that the crew has gone
And wouldn’t let me sign on?
All my islands have sunk in the deep,
So I can hardly relax or even oversleep
I feel as if I were home some nights
When we count all the ship lights
I guess I’ll never know why sparrows love the snow
We’ll turn off all of the lights and set this ballroom aglow
So tell me darling, do you wish we’d fall in love?
Time together is just never quite enough
When you and I are alone, I’ve never felt so at home
What will it take to make or break this hint of love?
We need time, only time
When we’re apart whatever are you thinking of?
If this is what I call home, why does it feel so alone?
So tell me darling, do you wish we’d fall in love?
All the time, all the time
Time together is just never quite enough
When we’re apart whatever are you thinking of?
What will it take to make or break this hint of love?
So tell me darling, do you wish we’d fall in love?
All the time
The end

Test

?Download download.txt
1
2
3
4
5
public class A{
  public static void main( String[] args ){
    System.out.println("test");
  }
}

Enjoy the beauty of the process

If you have ever been discouraged because of failure, please read on.

For often, achieving what you set out to do is not the important thing. Let me explain.

Two brothers decided to dig a deep hole behind their house. As they were working, a couple of older boys stopped by to watch.

“What are you doing?” asked one of the visitors.

“We plan to dig a hole all the way through the earth!” one of the brothers volunteered excitedly.

The older boys began to laugh, telling the younger ones that digging a hole all the way through the earth was impossible.

After a long silence, one of the diggers picked up a jar full of spiders, worms and a wide assortment of insects. He removed the lid and showed the wonderful contents to the scoffing visitors.

Then he said quietly and confidently, “Even if we don’t dig all the way through the earth, look what we found along the way!”

Their goal was far too ambitious, but it did cause them to dig. And that is what a goal is for-to cause us to move in the direction we have chosen; in other words, to set us to digging!

But not every goal will be fully achieved. Not every job will end successfully. Not every relationship will endure. Not every hope will come to pass. Not every love will last. Not every endeavor will be completed. Not every dream will be realized.

But when you fall short of your aim, perhaps you can say, “Yes, but look at what I found along the way! Look at the wonderful things which have come into my life because I tried to do something!”

It is in the digging that life is lived. And I believe it is joy in the journey, in the end, that truly matters.

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!