Whenever I click on the button(created by me), the emulator abruptly closes. Also, the button doesn't look like one on the emulator. Following is the screenshot. Please help!
The code is below:
package com.example.demoap;
import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
public void clickFunction(View view)
{
Log.i("Info", "Congratulations, button pressed!");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}