Advertisement
Guest User

z

a guest
May 20th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. // OFActivity.java
  2.  
  3. public void onCreate(Bundle savedInstanceState)
  4. {
  5. super.onCreate(savedInstanceState);
  6. String packageName = getPackageName();
  7. setContentView(R.layout.main_layout);
  8.  
  9. mSwitchButton = (Button)findViewById(R.id.switch_to_main);
  10.  
  11. mSwitchButton.setOnClickListener(new View.OnClickListener()
  12. {
  13. @Override
  14. public void onClick(View v)
  15. {
  16. Log.v(LogTag, "init view");
  17. }
  18. });
  19.  
  20. ofApp = new OFAndroid(packageName,this);
  21. }
  22.  
  23. // main_layout.xml
  24. <?xml version="1.0" encoding="utf-8"?>
  25. <RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
  26. <cc.openframeworks.OFGLSurfaceView android:id="@+id/of_gl_surface"
  27. android:layout_width="fill_parent"
  28. android:layout_height="fill_parent"/>
  29. <!-- add here other views' layouts -->
  30.  
  31. <Button
  32. android:id="@+id/switch_to_main"
  33. android:text="@string/switch_to_main"
  34. android:layout_width="wrap_content"
  35. android:layout_height="wrap_content"
  36. android:layout_gravity="bottom|center"
  37. />
  38.  
  39. </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement