Android 浮动信息框
2010-09-10 00:21:00 来源:WEB开发网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("");
}
});
}
}
view plaincopy to clipboardprint?
< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
< EditText
android:id="@+id/text_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
< Button
android:id="@+id/button_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="333"
/>
< /LinearLayout>
< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
< EditText
android:id="@+id/text_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
< Button
android:id="@+id/button_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="333"
/>
< /LinearLayout>
更多精彩
赞助商链接