Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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