SHARE
TWEET

Untitled

a guest Jun 19th, 2017 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.gpd916.bilal.gpd916_bilal_jalouk_chat;
  2.  
  3. import android.content.Intent;
  4. import android.os.Bundle;
  5. import android.support.v7.app.AppCompatActivity;
  6. import android.view.View;
  7. import android.widget.Button;
  8. import android.widget.EditText;
  9.  
  10. public class MainActivity extends AppCompatActivity {
  11.  
  12.  
  13.     @Override
  14.     protected void onCreate(Bundle savedInstanceState) {
  15.         super.onCreate(savedInstanceState);
  16.         setContentView(R.layout.activity_main);
  17.  
  18.          EditText name= (EditText)findViewById(R.id.email);
  19.          EditText Ip=(EditText) findViewById(R.id.password);
  20.         Button signin= (Button)findViewById(R.id.Login);
  21.  
  22.          final String Name;
  23.         Name = new String(name.getText().toString());
  24.         final String IPa;
  25.         IPa=new String(Ip.getText().toString());
  26.  
  27.         signin.setOnClickListener(new View.OnClickListener() {
  28.             @Override
  29.             public void onClick(View v) {
  30.                 Intent intent=new Intent(MainActivity.this,ChatActivity.class);
  31.                 intent.putExtra("name",Name);
  32.                 intent.putExtra("address",IPa);
  33.                 startActivity(intent);
  34.  
  35.             }
  36.         });
  37.  
  38.  
  39.  
  40.     }
  41. }
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top