Skip to content

Instantly share code, notes, and snippets.

@mcnemesis
Last active November 2, 2020 17:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcnemesis/c4bc68792a2ca2b6a9f833f2dfe1c5bb to your computer and use it in GitHub Desktop.
Save mcnemesis/c4bc68792a2ca2b6a9f833f2dfe1c5bb to your computer and use it in GitHub Desktop.
Example Activity using the DNAP Histrion as an embed
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