Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. package com.example.bc67.myapplication;
  2.  
  3. import android.support.v7.app.ActionBarActivity;
  4. import android.os.Bundle;
  5. import android.view.Menu;
  6. import android.view.MenuItem;
  7. import android.view.View;
  8. import android.widget.Button;
  9.  
  10. public void selfchange(View view) {
  11. }
  12. Button button_test = (Button)findViewById(R.id.button1);
  13. button_test.setText("Click Me !");
  14. }
  15.  
  16. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  17. xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
  18. android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
  19. android:paddingRight="@dimen/activity_horizontal_margin"
  20. android:paddingTop="@dimen/activity_vertical_margin"
  21. android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
  22.  
  23. <Button
  24. android:layout_width="wrap_content"
  25. android:layout_height="wrap_content"
  26. android:text="New a Button"
  27. android:id="@+id/button1"
  28. android:layout_centerVertical="true"
  29. android:layout_centerHorizontal="true"
  30. android:clickable="true"
  31. android:onClick="selfchange"/>
  32. </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement