Guest User

Reddit

a guest
Dec 1st, 2013
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1. package com.example.reddit;
  2.  
  3. import im.goel.jreddit.user.User;
  4. import android.app.Activity;
  5. import android.os.Bundle;
  6. import android.view.Menu;
  7. import android.view.View;
  8. import android.widget.Button;
  9. import android.widget.EditText;
  10. import android.widget.TextView;
  11.  
  12. public class MainActivity extends Activity {
  13.     private TextView username;
  14.     private TextView password;
  15.    
  16.     @Override
  17.     protected void onCreate(Bundle savedInstanceState) {
  18.         super.onCreate(savedInstanceState);
  19.         setContentView(R.layout.activity_main);
  20.        
  21.         username = (EditText) findViewById(R.id.username);
  22.         password = (EditText) findViewById(R.id.password);     
  23.     }
  24.    
  25.     public void onClickBtn(View v)
  26.     {
  27.         String usern = username.getText().toString();
  28.         String passw = password.getText().toString();
  29.        
  30.         User user = new User(usern, passw);
  31.         try {
  32.             user.connect();
  33.             System.out.println("sldkfj");
  34.         } catch (Exception e) {
  35.             // TODO Auto-generated catch block
  36.             e.printStackTrace();
  37.         }
  38.     }
  39.  
  40.     @Override
  41.     public boolean onCreateOptionsMenu(Menu menu) {
  42.         // Inflate the menu; this adds items to the action bar if it is present.
  43.         getMenuInflater().inflate(R.menu.main, menu);
  44.         return true;
  45.     }
  46.  
  47. }
Add Comment
Please, Sign In to add comment