Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MainActivity extends Activity
- {
- /** Called when the activity is first created. */
- GLSurfaceView glView;
- Button btnUp;
- Button btnDown;
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- glView=new GLSurfaceView(this);
- glView.setRenderer(new GLRenderer());
- setContentView(glView);
- btnUp=(Button)findViewById(R.id.up);
- btnDown=(Button)findViewById(R.id.down);
- LinearLayout layout = new LinearLayout(this);
- layout.setOrientation(LinearLayout.VERTICAL);
- layout.setGravity(Gravity.BOTTOM | Gravity.LEFT);
- LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.MATCH_PARENT,
- LinearLayout.LayoutParams.MATCH_PARENT);
- LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- View linearLayoutView = inflater
- .inflate(R.layout.updown, layout, false);
- layout.addView(linearLayoutView);
- btnUp.setOnClickListener(new OnClickListener(){
- public void onClick(View v){
- }
- });
- addContentView(layout, layoutParams);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement