From what I can see in your code, you don't have a button attached to your onClick()
method. You can do this two ways, in xml or programmatically.
In xml
<Button
...
android:onClick="functionName"/>
Then in your code, define your function which you named in your xml
public void functionName(View v)
{
// some code
finish();
}
Programmatically, declare your button
Button aBtn = (Button) findViewById(R.id.button_id);
aBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v)
{
// some code
AboutActivity.this.finish()
}
});
If you have already attached your button to the onClick()
in some way not shown then you may be finishing your main activity. In which case, describe what happens when you click the button and show your Main Activity