public MessageBox(View view, string message) { View v = view; if (v == null) v = ApplicationActivity.MainView; bool err = (v == null); if (!err) err = (message == null); if(err) { ConsoleMessage c = new ConsoleMessage("ERROR in MessageBox: MainView is null", "ERROR", 0, ConsoleMessage.MessageLevel.ERROR); return; } java.lang.StringBuilder sb = new java.lang.StringBuilder(message); Toast.makeText(view.getContext(), sb, Toast.LENGTH_SHORT).show(); }
public static void initLibrary(View view) { View v = view; if (v == null) v = ApplicationActivity.MainView; if (v == null) { ConsoleMessage c = new ConsoleMessage("ERROR in initLibrary: MainView is null","ERROR",0,ConsoleMessage.MessageLevel.ERROR); return; } // This is the main initialization call that takes in your Context, the Application ID, the server you would like to connect to, and your PayPalListener PayPal.fetchDeviceReferenceTokenWithAppID(v.getContext(), appID, server, new ResultDelegate()); // -- These are required settings. PayPal.getInstance().setLanguage("en_US"); // Sets the language for the library. // -- }