Untitled

 avatar
unknown
plain_text
a month ago
1.2 kB
5
Indexable
public class UnityPlayerActivity extends Activity implements IUnityPlayerLifecycleEvents
{
    protected UnityPlayer mUnityPlayer; // don't change the name of this variable; referenced from native code

   
    protected String updateUnityCommandLineArguments(String cmdLine)
    {
        return cmdLine;
    }

    // Setup activity layout
    @Override protected void onCreate(Bundle savedInstanceState)
    {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);

        String cmdLine = updateUnityCommandLineArguments(getIntent().getStringExtra("unity"));
        getIntent().putExtra("unity", cmdLine);

        mUnityPlayer = new UnityPlayer(this, this);
        setContentView(mUnityPlayer);
        mUnityPlayer.requestFocus();
        Log.d("", "onCreate: "+getIntent().putExtra("unity", cmdLine));
        Bundle bundle = getIntent().getExtras();
        if (bundle != null) {
            Log.d("", "onCreate: "+bundle.getString("unity"));
            Toast.makeText(this, "Unity = "+bundle.getString("unity") , Toast.LENGTH_SHORT).show();

        } else {

        }
    }
Leave a Comment