xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="[Link]">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/b1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
tools:layout_editor_absoluteX="147dp"
tools:layout_editor_absoluteY="367dp" />
<EditText
android:id="@+id/et1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:text="Name"
tools:layout_editor_absoluteX="74dp"
tools:layout_editor_absoluteY="95dp" />
<EditText
android:id="@+id/et2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:text="Name"
tools:layout_editor_absoluteX="74dp"
tools:layout_editor_absoluteY="179dp" />
</LinearLayout>
java
package [Link].mypro1;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
private EditText et1,et2;
private Button b1;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
//page work
et1 = (EditText) findViewById([Link].et1);
et2 = (EditText) findViewById([Link].et2);
b1 =(Button) findViewById([Link].b1);
[Link](new [Link]() {
@Override
public void onClick(View v) {
int a = [Link]([Link]().toString());
a++;
[Link](""+a);
}
});
class MyclickListner implements [Link]{
@Override
public void onClick(View v) {
int a = [Link]([Link]().toString());
a++;
}
}