当前位置:操作系统 > 安卓/Android >>

Android Dialog样式--->Activity 界面

 

 

\

 

----------------------.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <ImageView
        android:layout_gravity="center_horizontal"
        android:layout_width="240dp"
        android:layout_height="wrap_content"
        android:src="@drawable/icon" />


    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:text="确定" />

</LinearLayout>

 

 

 

---------------------------------.java

package gongzibai.co.cc;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Webview1Activity extends
  Activity {

 /** Called when the activity is first created. */
 @Override
 public void onCreate(
   Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  setContentView(R.layout.main);
  Button button1=(Button)findViewById(R.id.button1);
  button1.setOnClickListener(new OnClickListener() {
  
   @Override
   public void onClick(View v) {
    // TODO Auto-generated method stub
   
   
    finish();
   
   }
  });

 }
}

 作者:gongzibai
 

补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,