package com.example.student.rajawalitest; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.ViewGroup; import org.rajawali3d.surface.IRajawaliSurface; import org.rajawali3d.surface.RajawaliSurfaceView; public class MainActivity extends AppCompatActivity { Renderer renderer; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final RajawaliSurfaceView surface = new RajawaliSurfaceView(this); surface.setFrameRate(60.0); surface.setRenderMode(IRajawaliSurface.RENDERMODE_WHEN_DIRTY); // Add mSurface to your root view addContentView(surface, new ActionBar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT)); renderer = new Renderer(this); surface.setSurfaceRenderer(renderer); } }