Skip to content

Commit 47c6cfd

Browse files
committed
Demo ScreenActivity App
OnCLick onCreate password and username Login Page
1 parent 0460d74 commit 47c6cfd

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

demoapp/MainActivity.java

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.lenovo.demoapp;
2+
3+
import android.support.v7.app.AppCompatActivity;
4+
import android.os.Bundle;
5+
import android.util.Log;
6+
import android.view.View;
7+
import android.widget.EditText;
8+
import android.widget.Toast;
9+
10+
11+
public class MainActivity extends AppCompatActivity {
12+
13+
public void clickFunction(View view)
14+
{
15+
Toast.makeText(MainActivity.this,"hi there !",Toast.LENGTH_SHORT).show();
16+
17+
EditText myTextField = (EditText) findViewById(R.id.UserName);
18+
EditText myPassword = (EditText) findViewById(R.id.Password);
19+
20+
21+
Toast.makeText(MainActivity.this,"Username : "+myTextField.getText().toString()+ " Password: "+myPassword.getText().toString() ,Toast.LENGTH_SHORT).show();
22+
//Log.i("Info","Button Pressed!");
23+
Log.i("Info","Username : "+myTextField.getText().toString()+ " Password: "+myPassword.getText().toString());
24+
}
25+
@Override
26+
protected void onCreate(Bundle savedInstanceState) {
27+
super.onCreate(savedInstanceState);
28+
setContentView(R.layout.activity_main);
29+
}
30+
}

0 commit comments

Comments
 (0)