Advertisement
Guest User

MyActivity

a guest
Oct 24th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.81 KB | None | 0 0
  1. package kirill.test;
  2.  
  3. import android.app.Activity;
  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. import android.widget.TextView;
  10.  
  11.  
  12. public class MyActivity extends Activity implements View.OnClickListener{
  13.  
  14.  
  15.     public TextView server;
  16.     public TextView login;
  17.     public TextView pass;
  18.     public Button button;
  19.  
  20.  
  21.     @Override
  22.     protected void onCreate(Bundle savedInstanceState) {
  23.         super.onCreate(savedInstanceState);
  24.         setContentView(R.layout.activity_my);
  25.  
  26.         server = (TextView) findViewById(R.id.Server);
  27.         login = (TextView) findViewById(R.id.login);
  28.         pass = (TextView) findViewById(R.id.pass);
  29.         button = (Button) findViewById(R.id.button);
  30.  
  31.         button.setOnClickListener(this);
  32.  
  33.  
  34.     }
  35.  
  36.  
  37.     @Override
  38.     public void onClick(View view) {
  39.         if (view.getId() == R.id.button) {
  40.             String pass_ = pass.getText().toString();
  41.             String server_ = server.getText().toString();
  42.             String login_ = login.getText().toString();
  43.         }
  44.     }
  45.  
  46.     @Override
  47.     public boolean onCreateOptionsMenu(Menu menu) {
  48.         // Inflate the menu; this adds items to the action bar if it is present.
  49.         getMenuInflater().inflate(R.menu.my, menu);
  50.         return true;
  51.     }
  52.  
  53.     @Override
  54.     public boolean onOptionsItemSelected(MenuItem item) {
  55.         // Handle action bar item clicks here. The action bar will
  56.         // automatically handle clicks on the Home/Up button, so long
  57.         // as you specify a parent activity in AndroidManifest.xml.
  58.         int id = item.getItemId();
  59.         if (id == R.id.action_settings) {
  60.             return true;
  61.         }
  62.         return super.onOptionsItemSelected(item);
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement