While experimenting with subclassing UnityPlayerActivity i had made a plugin with docs code. Code (CSharp): package com.company.product; import com.unity3d.player.UnityPlayerActivity; import android.os.Bundle; import android.util.Log; public class OverrideExample extends UnityPlayerActivity { protected void onCreate(Bundle savedInstanceState) { // call UnityPlayerActivity.onCreate() super.onCreate(savedInstanceState); // print debug message to logcat Log.d("OverrideActivity", "onCreate called!"); } public void onBackPressed() { // instead of calling UnityPlayerActivity.onBackPressed() we just ignore the back button event // super.onBackPressed(); Log.d("MyPluginActivity", "BackbuttonPressed"); } } As per the code onBackButton should not trigger the normal backbutton response and should print the message in log. But it is not happening, on back button press the message is never displayed. Am i missing something or what is the correct method. Please help
I think that Unity's activity is not propogating the back press to your activity, so you're never seeing it and cannot react to it.