1

单击此按钮时,我想启动另一个应用程序。

sharebtn = new Custom_ButtonField(share, shareactive, shareactive) {
            protected boolean navigationClick(int status, int time) {
                //I want to start another apps (Strawberry)
                return true;
            }
        };
        add(sharebtn);

这是草莓应用程序

public class StrawBerry extends UiApplication implements ActionListener {

public static void main(String url) {
    new StrawBerry(url).enterEventDispatcher();
}
}

我想传递String url给草莓应用程序。我怎样才能做到这一点?

4

1 回答 1

2

首先,系统永远不会调用您的 main 方法。正确的签名:

public static void main(String[] arguments){}

看看这篇文章以启动另一个带有参数的应用程序:How To - Launch a third-party application from another third-party application

在FB页面上发布。你需要类似的东西:

private final String NEXT_URL = "http://www.facebook.com/connect/login_success.html";
private final String APPLICATION_ID = "your id";
private final String APPLICATION_SECRET = "your secret";
private Facebook fb;
private User user;
...
fb = Facebook.getInstance(new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, Facebook.Permissions.PUBLISH_STREAM));
user = fb.getUser(pUserId);
user.publishPost(messageEditField.getText(), linkEditField.getText(), pictureEditField.getText(), nameEditField.getText(), captionEditField.getText(), descriptionEditField.getText(), sourceEditField.getText());
于 2012-07-17T08:05:25.933 回答