import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import com.cnmobile.beibei.R;
/**
* @author 仿彈出popwindown菜單
*/
public class AddDialogActivity extends Activity implements OnClickListener {
private LinearLayout layout01, layout02, layout03;
int sexStr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dialog);
initView();
}
/**
* 初始化組件
*/
private void initView() {
// 得到布局組件對象并設置監(jiān)聽事件
layout01 = (LinearLayout) findViewById(R.id.llayout01);
layout02 = (LinearLayout) findViewById(R.id.llayout02);
layout03 = (LinearLayout) findViewById(R.id.llayout03);
layout01.setOnClickListener(this);
layout02.setOnClickListener(this);
layout03.setOnClickListener(this);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
finish();
return true;
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.llayout01:
Intent intent = new Intent(this, AddPetActivity.class);
startActivity(intent);
finish();
break;
case R.id.llayout02:
Intent intent1 = new Intent(this, AddTerminalActivity.class);
startActivity(intent1);
finish();
break;
case R.id.llayout03:
Intent intent2 = new Intent(this, MipcaActivityCapture.class);
startActivity(intent2);
finish();
break;
default:
break;
}
}
}最后在AndroidManifest文件里面聲明

成都創(chuàng)新互聯(lián)公司主營涼城網(wǎng)站建設的網(wǎng)絡公司,主營網(wǎng)站建設方案,重慶APP開發(fā),涼城h5小程序定制開發(fā)搭建,涼城網(wǎng)站營銷推廣歡迎涼城等地區(qū)企業(yè)咨詢
<activity android:name="com.cnmobile.beibei.activity.AddDialogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
本文題目:安卓仿微信右上角彈出菜單窗口
URL地址:http://www.chinadenli.net/article48/ihoehp.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)頁設計公司、定制開發(fā)、、企業(yè)網(wǎng)站制作、外貿建站、響應式網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)