Last active
November 2, 2020 17:09
-
-
Save mcnemesis/c4bc68792a2ca2b6a9f833f2dfe1c5bb to your computer and use it in GitHub Desktop.
Example Activity using the DNAP Histrion as an embed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nuchwezi.nulabs; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.View; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
} | |
public void onClick(View view) { | |
switchToDNAP_Persona("bb765c31-6959-49d0-b192-6c83bdab5cb4", "LABS"); | |
} | |
// param: personaUUID: default persona to try to launch upon opening histrion | |
// param: autoInstallChannel: default channel spec to apply when searching for DNAP channels from which to fetch personas. | |
private void switchToDNAP_Persona(String personaUUID, String autoInstallChannel) { | |
Intent _intent = new Intent(MainActivity.this, com.nuchwezi.dnaphistrion.HistrionMainActivity.class); | |
if(personaUUID != null){ | |
_intent.putExtra(com.nuchwezi.dnaphistrion.HistrionMainActivity.PERSONA_REFERENCES.KEY_PERSONA_UUID, personaUUID); | |
} | |
if(autoInstallChannel != null){ | |
_intent.putExtra(com.nuchwezi.dnaphistrion.HistrionMainActivity.PERSONA_REFERENCES.AUTO_INSTALL_CHANNEL, autoInstallChannel); | |
} | |
startActivity(_intent); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment