• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java UIAlertView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.robovm.apple.uikit.UIAlertView的典型用法代码示例。如果您正苦于以下问题:Java UIAlertView类的具体用法?Java UIAlertView怎么用?Java UIAlertView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UIAlertView类属于org.robovm.apple.uikit包,在下文中一共展示了UIAlertView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: publishFeedAction

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
private void publishFeedAction() {
    FacebookHandler.getInstance().publishFeed("RoboVM", "RoboPods Facebook iOS",
            "Hello World! This has been sent by RoboVM!!!", "http://www.robovm.com",
            "http://www.robovm.com/wp-content/uploads/2015/03/RoboVM-logo-wide.png",
            new FacebookHandler.RequestListener() {
                @Override
                public void onSuccess(NSObject result) {
                    UIAlertView alert = new UIAlertView("Success!", "Your message has been posted!", null, "OK");
                    alert.show();
                }

                @Override
                public void onError(String message) {
                    FacebookHandler.getInstance().alertError("Error during feed!", message);
                }

                @Override
                public void onCancel() {}
            });
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:21,代码来源:MainMenuViewController.java


示例2: logEventAction

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
private void logEventAction() {
    UIAlertView alert = new UIAlertView("Log Event", "Select an event to send:", new UIAlertViewDelegateAdapter() {
        @Override
        public void clicked(UIAlertView alertView, long buttonIndex) {
            switch ((int) buttonIndex) {
            case 1:
                Flurry.logEvent("Event_A");
                break;
            case 2:
                Flurry.logEvent("Event_B");
                break;
            default:
                break;
            }
        }
    }, "Cancel", "Event A", "Event B");
    alert.show();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:19,代码来源:MainMenuViewController.java


示例3: logEventWithParametersAction

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
private void logEventWithParametersAction() {
    UIAlertView alert = new UIAlertView("Log Event with Parameters", "Select parameters:",
            new UIAlertViewDelegateAdapter() {
                @Override
                public void clicked(UIAlertView alertView, long buttonIndex) {
                    final String eventName = "Event_with_Parameters";
                    switch ((int) buttonIndex) {
                    case 1:
                        Map<String, String> params1 = new HashMap<>();
                        params1.put("Param1", String.valueOf(101));
                        Flurry.logEvent(eventName, params1);
                        break;
                    case 2:
                        NSDictionary<?, ?> params2 = new NSMutableDictionary<>();
                        params2.put("Param1", "Test");
                        params2.put("Param2", 202);
                        Flurry.logEvent(eventName, params2);
                        break;
                    default:
                        break;
                    }
                }
            }, "Cancel", "Param1 = 101", "Param1 = Test, Param2 = 202");
    alert.show();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:26,代码来源:MainMenuViewController.java


示例4: logErrorAction

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
private void logErrorAction() {
    UIAlertView alert = new UIAlertView("Log Error", "Press OK to log an exception.",
            new UIAlertViewDelegateAdapter() {
                @Override
                public void clicked(UIAlertView alertView, long buttonIndex) {
                    if (buttonIndex == 1) {
                        try {
                            // Let's produce some silly error.
                            Integer.valueOf("Error");
                        } catch (NumberFormatException e) {
                            Flurry.logError(e);
                        }
                    }
                }
            }, "Cancel", "OK");
    alert.show();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:18,代码来源:MainMenuViewController.java


示例5: setUserID

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
private void setUserID() {
    UIAlertView alert = new UIAlertView("Set User ID", "", new UIAlertViewDelegateAdapter() {
        @Override
        public void clicked(UIAlertView alertView, long buttonIndex) {
            if (buttonIndex == 1) {
                UITextField textField = alertView.getTextField(0);
                if (textField.getText() != null && !textField.getText().isEmpty()) {
                    String userID = textField.getText();
                    Flurry.setUserID(userID);
                }

                setUserAge();
            }
        }
    }, "Cancel", "OK");
    alert.setAlertViewStyle(UIAlertViewStyle.PlainTextInput);
    alert.show();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:19,代码来源:MainMenuViewController.java


示例6: setUserAge

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
private void setUserAge() {
    UIAlertView alert = new UIAlertView("Set User Age", "", new UIAlertViewDelegateAdapter() {
        @Override
        public void clicked(UIAlertView alertView, long buttonIndex) {
            if (buttonIndex == 1) {
                UITextField textField = alertView.getTextField(0);
                if (textField.getText() != null && !textField.getText().isEmpty()) {
                    int age = Integer.valueOf(textField.getText());
                    Flurry.setAge(age);
                }

                setUserGender();
            }
        }
    }, "Cancel", "OK");
    alert.setAlertViewStyle(UIAlertViewStyle.PlainTextInput);
    alert.getTextField(0).setKeyboardType(UIKeyboardType.NumberPad);
    alert.show();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:20,代码来源:MainMenuViewController.java


示例7: checkAddressBookAccess

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
/**
 * Check the authorization status of our application for Address Book
 */
private void checkAddressBookAccess() {
    switch (ABAddressBook.getAuthorizationStatus()) {
    case Authorized:
        // Update our UI if the user has granted access to their Contacts
        accessGrantedForAddressBook();
        break;
    case NotDetermined:
        // Prompt the user for access to Contacts if there is no definitive
        // answer
        requestAddressBookAccess();
        break;
    case Denied:
    case Restricted:
        // Display a message if the user has denied or restricted access to
        // Contacts
        UIAlertView alert = new UIAlertView("Privacy Warning", "Permission was not granted for Contacts.", null,
                "OK");
        alert.show();
        break;
    default:
        break;
    }
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:27,代码来源:QuickContactsViewController.java


示例8: showPersonViewController

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
/**
 * Called when users tap "Display and Edit Contact" in the application.
 * Searches for a contact named "Appleseed" in in the address book. Displays
 * and allows editing of all information associated with that contact if the
 * search is successful. Shows an alert, otherwise.
 */
private void showPersonViewController() {
    // Search for the person named "Appleseed" in the address book
    List<ABPerson> people = addressBook.getPeople("Appleseed");
    // Display "Appleseed" information if found in the address book
    if (people != null && people.size() > 0) {
        ABPerson person = people.get(0);
        ABPersonViewController picker = new ABPersonViewController();
        picker.setPersonViewDelegate(this);
        picker.setDisplayedPerson(person);
        // Allow users to edit the person’s information
        picker.setAllowsEditing(true);
        getNavigationController().pushViewController(picker, true);
    } else {
        // Show an alert if "Appleseed" is not in Contacts
        UIAlertView alert = new UIAlertView("Error", "Could not find Appleseed in the Contacts application", null,
                "Cancel");
        alert.show();
    }
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:26,代码来源:QuickContactsViewController.java


示例9: showUnknownPersonViewController

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
/**
 * Called when users tap "Edit Unknown Contact" in the application.
 */
private void showUnknownPersonViewController() {
    ABPerson person = ABPerson.create();
    try {
        person.addEmailAddress(new ABPersonEmailAddress("[email protected]", ABPropertyLabel.Other));

        ABUnknownPersonViewController picker = new ABUnknownPersonViewController();
        picker.setUnknownPersonViewDelegate(this);
        picker.setDisplayedPerson(person);
        picker.setAllowsAddingToAddressBook(true);
        picker.setAllowsActions(true);
        picker.setAlternateName("John Appleseed");
        picker.setTitle("John Appleseed");
        picker.setMessage("Company, Inc");

        getNavigationController().pushViewController(picker, true);
    } catch (NSErrorException e) {
        UIAlertView alert = new UIAlertView("Error", "Could not create unknown user", null, "Cancel");
        alert.show();
    }

}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:25,代码来源:QuickContactsViewController.java


示例10: clicked

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
@Override
@Method(selector = "alertView:clickedButtonAtIndex:")
public void clicked(UIAlertView alertView,
		@MachineSizedSInt long buttonIndex) {
	// TODO Auto-generated method stub
	
}
 
开发者ID:tianqiujie,项目名称:robovm-ios-bindings,代码行数:8,代码来源:MobClick.java


示例11: cancel

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
@Override
@Method(selector = "alertViewCancel:")
public
void cancel(UIAlertView alertView) {
	// TODO Auto-generated method stub
	
}
 
开发者ID:tianqiujie,项目名称:robovm-ios-bindings,代码行数:8,代码来源:MobClick.java


示例12: willPresent

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
@Override
@Method(selector = "willPresentAlertView:")
public
void willPresent(UIAlertView alertView) {
	// TODO Auto-generated method stub
	
}
 
开发者ID:tianqiujie,项目名称:robovm-ios-bindings,代码行数:8,代码来源:MobClick.java


示例13: didPresent

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
@Override
@Method(selector = "didPresentAlertView:")
public
void didPresent(UIAlertView alertView) {
	// TODO Auto-generated method stub
	
}
 
开发者ID:tianqiujie,项目名称:robovm-ios-bindings,代码行数:8,代码来源:MobClick.java


示例14: willDismiss

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
@Override
@Method(selector = "alertView:willDismissWithButtonIndex:")
public
void willDismiss(UIAlertView alertView, @MachineSizedSInt long buttonIndex) {
	// TODO Auto-generated method stub
	
}
 
开发者ID:tianqiujie,项目名称:robovm-ios-bindings,代码行数:8,代码来源:MobClick.java


示例15: didDismiss

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
@Override
@Method(selector = "alertView:didDismissWithButtonIndex:")
public
void didDismiss(UIAlertView alertView, @MachineSizedSInt long buttonIndex) {
	// TODO Auto-generated method stub
	
}
 
开发者ID:tianqiujie,项目名称:robovm-ios-bindings,代码行数:8,代码来源:MobClick.java


示例16: shouldEnableFirstOtherButton

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
@Override
@Method(selector = "alertViewShouldEnableFirstOtherButton:")
public
boolean shouldEnableFirstOtherButton(UIAlertView alertView) {
	// TODO Auto-generated method stub
	return false;
}
 
开发者ID:tianqiujie,项目名称:robovm-ios-bindings,代码行数:8,代码来源:MobClick.java


示例17: didTapShare

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
@IBAction
private void didTapShare(UIBarButtonItem sender) {
    GAITracker tracker = GAI.getSharedInstance().getTracker(GoogleAnalyticsApp.TRACKER_ID);
    NSMutableDictionary<?, ?> event = GAIDictionaryBuilder.createEvent("Action", "Share", null, null).build();
    tracker.send(event);

    String title = String.format("Share: %s", getSelectedViewController().getTitle());
    String message = "Share is not implemented in this quickstart";
    new UIAlertView(title, message, null, "OK").show();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:11,代码来源:PatternTabBarController.java


示例18: showActionCompleteAlert

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
private void showActionCompleteAlert(NSError error, String gerund) {
    String alertMessage, alertTitle;
    if (error != null) {
        alertMessage = String.format("Error %s: %s", gerund, error.getLocalizedDescription());
        alertTitle = "Error";
    } else {
        alertMessage = String.format(
                "All done %s! You may need to restart your application to see the changes take effect.", gerund);
        alertTitle = "Done!";
    }

    new UIAlertView(alertTitle, alertMessage, null, "Okay").show();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:14,代码来源:AdminViewController.java


示例19: showFullScreenAd

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
/**
 * Invoke a takeover at a natural pause in your app. For example, when a
 * level is completed, an article is read or a button is pressed. We will
 * mock the display of a takeover when a button is pressed.
 */
@IBAction
private void showFullScreenAd(UIButton sender) {
    // Check if the ad is ready. If so, display the ad.
    if (adInterstitial.isReady()) {
        adInterstitial.present(this);
    } else {
        adInterstitial.fetchAd();

        UIAlertView alert = new UIAlertView("No ad ready", "Please wait while a new ad is requested.", null, "OK");
        alert.show();
    }
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:18,代码来源:InterstitialViewController.java


示例20: setUserGender

import org.robovm.apple.uikit.UIAlertView; //导入依赖的package包/类
private void setUserGender() {
    UIAlertView alert = new UIAlertView("Set User Gender", "", new UIAlertViewDelegateAdapter() {
        @Override
        public void clicked(UIAlertView alertView, long buttonIndex) {
            if (buttonIndex == 1) {
                Flurry.setGender("m");
            } else if (buttonIndex == 2) {
                Flurry.setGender("f");
            }
        }
    }, "Cancel", "Male", "Female");
    alert.show();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:14,代码来源:MainMenuViewController.java



注:本文中的org.robovm.apple.uikit.UIAlertView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Language类代码示例发布时间:2022-05-23
下一篇:
Java BrokerEndPoint类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap