您好,登錄后才能下訂單哦!
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() { // 得到布局組件對象并設置監聽事件 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文件里面聲明
<activity android:name="com.cnmobile.beibei.activity.AddDialogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。