-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4b0330
commit 70bf383
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.lianliankan.xiaoyoulei.android; | ||
|
||
import com.lianliankan.xiaoyoulei.R; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.widget.Button; | ||
import android.widget.ImageButton; | ||
import android.view.*; | ||
import android.view.View.OnClickListener; | ||
import com.lianliankan.xiaoyoulei.*; | ||
|
||
public class Menu extends Activity{ | ||
|
||
private Button Button_1 ; | ||
private Button Button_2 ; | ||
private Button Button_3 ; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
// TODO Auto-generated method stub | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.menu); | ||
|
||
Button_1 = (Button)findViewById(R.id.button_1); | ||
Button_2 = (Button)findViewById(R.id.button_2); | ||
Button_3 = (Button)findViewById(R.id.button_3); | ||
|
||
OnClickListener lin = new StartGame() ; | ||
Button_1.setOnClickListener(lin); | ||
Button_2.setOnClickListener(lin); | ||
Button_3.setOnClickListener(lin); | ||
} | ||
class StartGame implements OnClickListener{ | ||
|
||
public void onClick(View v) | ||
{ | ||
switch(v.getId()) | ||
{ | ||
case R.id.button_1 : | ||
Intent myintent= new Intent(); | ||
myintent.putExtra("model", 1) ; | ||
myintent.setClass(Menu.this , WelActivity.class ); | ||
Menu.this.startActivity(myintent); | ||
break ; | ||
case R.id.button_2 : | ||
Intent myintent2 = new Intent(); | ||
myintent2.putExtra("model", 2) ; | ||
myintent2.setClass(Menu.this , WelActivity.class ); | ||
Menu.this.startActivity(myintent2); | ||
break ; | ||
case R.id.button_3: | ||
finish(); | ||
break ; | ||
} | ||
} | ||
} | ||
} |