@Override
  public boolean didFinishLaunching(
      UIApplication application, UIApplicationLaunchOptions launchOptions) {
    // Set up the view controller.
    rootViewController = new APAViewController();

    // Create a new window at screen size.
    window = new UIWindow(UIScreen.getMainScreen().getBounds());
    // Set our viewcontroller as the root controller for the window.
    window.setRootViewController(rootViewController);
    // Make the window visible.
    window.makeKeyAndVisible();

    return true;
  }
Ejemplo n.º 2
0
  @Override
  public void didFinishLaunching(UIApplication application) {
    window = new UIWindow(UIScreen.getMainScreen().getBounds());
    window.makeKeyAndVisible();

    UIViewController viewController = new UIViewController();

    UIButton boton = new UIButton(new CGRect(10, 10, 200, 30));
    boton.setBackgroundColor(new UIColor(1, 0, 0, 0.5f));
    boton.setTitle("Send Mail", UIControlState.Normal);
    boton.addOnTouchUpInsideListener(
        new OnTouchUpInsideListener() {
          @Override
          public void onTouchUpInside(UIControl control, UIEvent event) {
            sendMail();
          }
        });
    viewController.setView(boton);

    window.setRootViewController(viewController);
  }
Ejemplo n.º 3
0
 @SuppressWarnings({"unchecked", "rawtypes"})
 private void sendMail() {
   MFMailComposeViewController picker = new MFMailComposeViewController();
   picker.setMailComposeDelegate(
       new MFMailComposeViewControllerDelegate.Adapter() {
         @Override
         public void mailComposeControllerDidFinish(
             MFMailComposeViewController controller, MFMailComposeResult result, NSError error) {
           controller.dismissViewController(true, null);
         }
       });
   NSArray usersTo = new NSArray(new NSString("*****@*****.**"));
   picker.setToRecipients(usersTo);
   picker.setSubject("Test Mail");
   window.getRootViewController().presentViewController(picker, true, null);
 }