Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. public class MainActivity extends Activity
  2.  
  3. @Override
  4. protected void onCreate(Bundle savedInstanceState)
  5. {
  6. super.onCreate(savedInstanceState);
  7. setContentView(R.layout.activity_main);
  8. Button PrefrencesButtonb=(Button) findViewById(R.id.PrefrencesButton);
  9.  
  10. PrefrencesButtonb.setOnClickListener(new View.OnClickListener()
  11. {
  12. @Override
  13. public void onClick(View v)
  14. {
  15. Intent ip = new Intent(getApplicationContext(),PrefrencesPage.class);
  16. startActivity(ip);
  17. }
  18. });
  19.  
  20. public class PrefrencesPage extends MainActivity
  21. {
  22.  
  23. protected void onCreate(Bundle savedInstanceState)
  24. {
  25.  
  26. super.onCreate(savedInstanceState);
  27. setContentView(R.layout.prefrences);
  28.  
  29. Button PrefrencesBackButtonb=(Button) findViewById(R.id.PrefrencesBackButton);
  30.  
  31. PrefrencesBackButtonb.setOnClickListener(new View.OnClickListener()
  32. {
  33.  
  34. @Override
  35. public void onClick(View v)
  36. {
  37. finish();
  38.  
  39. }
  40. });
  41.  
  42. }
  43.  
  44. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  45. xmlns:tools="http://schemas.android.com/tools"
  46. android:layout_width="match_parent"
  47. android:layout_height="match_parent"
  48. android:paddingBottom="@dimen/activity_vertical_margin"
  49. android:paddingLeft="@dimen/activity_horizontal_margin"
  50. android:paddingRight="@dimen/activity_horizontal_margin"
  51. android:paddingTop="@dimen/activity_vertical_margin"
  52. android:background="@drawable/sky_backgorund_day"
  53. tools:context="com.example.bio_balloon_initial_main_menu_no_andengine.MainActivity" >
  54. <Button
  55. android:id="@+id/PrefrencesButton"
  56. android:layout_width="200dp"
  57. android:layout_height="wrap_content"
  58. android:layout_alignLeft="@+id/HiScoreButton"
  59. android:layout_alignParentRight="true"
  60. android:layout_below="@+id/QuoteButton"
  61. android:layout_marginTop="20dp"
  62. android:text="Preferences"
  63. android:textColor="#ffffff" />
  64. </RelativeLayout>
  65.  
  66. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  67. xmlns:tools="http://schemas.android.com/tools"
  68. android:layout_width="match_parent"
  69. android:layout_height="match_parent"
  70. android:background="@drawable/night_sky_backgorund"
  71. android:orientation="vertical" >
  72. <Button
  73. android:id="@+id/PrefrencesBackButton"
  74. android:layout_width="wrap_content"
  75. android:layout_height="wrap_content"
  76. android:layout_alignParentBottom="true"
  77. android:layout_centerHorizontal="true"
  78. android:layout_marginBottom="30dp"
  79. android:background="@drawable/main_menu_style"
  80. android:text="Back"
  81. android:textColor="#ffffff" />
  82. </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement