开发学院手机开发Android 开发 Android 浮动信息框 阅读

Android 浮动信息框

 2010-09-10 00:21:00 来源:WEB开发网   
核心提示:package my.android.toast;import android.app.Activity;import android.os.Bundle;import android.text.Editable;import android.view.View;import android.view.View.OnC

package my.android.toast;

import android.app.Activity;

import android.os.Bundle;

import android.text.Editable;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.Button;

import android.widget.EditText;

import android.widget.Toast;

public class ShowToast extends Activity {

private EditText mEditText;

private Button mButton;

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

mEditText = (EditText) findViewById(R.id.text_id);

mButton = (Button) findViewById(R.id.button_id);

mButton.setOnClickListener(new OnClickListener() {

public void onClick(View v) {

// TODO Auto-generated method stub

Editable Str;

Str = mEditText.getText();

Toast.makeText(ShowToast.this, Str, Toast.LENGTH_SHORT).show();

mEditText.setText("");

}

});

}

}

package my.android.toast;

import android.app.Activity;

import android.os.Bundle;

import android.text.Editable;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.Button;

import android.widget.EditText;

import android.widget.Toast;

public class ShowToast extends Activity {

private EditText mEditText;

private Button mButton;

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

mEditText = (EditText) findViewById(R.id.text_id);

1 2  下一页

Tags:Android 浮动 信息

编辑录入:coldstar [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
更多精彩
    赞助商链接

    热点阅读
      焦点图片
        最新推荐
          精彩阅读