📜  从 android 开始统一 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:32.738000             🧑  作者: Mango

代码示例1
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.xxx.xxx.UnityPlayerActivity;

public class MainActivity extends AppCompatActivity {

private Button button;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    button= (Button)findViewById(R.id.button);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent i = new Intent(MainActivity.this, UnityPlayerActivity.class);
            startActivity(i);
        }
    });
}
}